Changeset ee5b35a in mainline for contrib/arch/hadlbppp.py
- Timestamp:
- 2009-09-16T13:42:23Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- fed03a3
- Parents:
- 2a70672
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
contrib/arch/hadlbppp.py
r2a70672 ree5b35a 35 35 36 36 INC, POST_INC, BLOCK_COMMENT, LINE_COMMENT, SYSTEM, ARCH, HEAD, BODY, NULL, \ 37 INST, VAR, FIN, BIND, TO, SEEN_NL, IFACE, PROTOTYPE, PAR_LEFT, PAR_RIGHT, SIGNATURE, PROTOCOL = range(21) 38 39 context = set() 40 interface = None 41 architecture = None 42 protocol = None 37 INST, VAR, FIN, BIND, TO, SUBSUME, DELEGATE, IFACE, PROTOTYPE, PAR_LEFT, \ 38 PAR_RIGHT, SIGNATURE, PROTOCOL, FRAME, PROVIDES, REQUIRES = range(25) 43 39 44 40 def usage(prname): 45 41 "Print usage syntax" 46 print prname + " <OUTPUT>" 42 43 print "%s <OUTPUT>" % prname 47 44 48 45 def tabs(cnt): … … 91 88 return tokens 92 89 93 def preproc_bp(outname, tokens):94 "Preprocess tentative statements in Behavior Protocol"95 96 result = []97 i = 098 99 while (i < len(tokens)):100 if (tokens[i] == "tentative"):101 if ((i + 1 < len(tokens)) and (tokens[i + 1] == "{")):102 i += 2103 start = i104 level = 1105 106 while ((i < len(tokens)) and (level > 0)):107 if (tokens[i] == "{"):108 level += 1109 elif (tokens[i] == "}"):110 level -= 1111 112 i += 1113 114 if (level == 0):115 result.append("(")116 result.extend(preproc_bp(outname, tokens[start:(i - 1)]))117 result.append(")")118 result.append("+")119 result.append("NULL")120 else:121 print "%s: Syntax error in tentative statement" % outname122 else:123 print "%s: Unexpected tentative statement" % outname124 else:125 result.append(tokens[i])126 127 i += 1128 129 return result130 131 def preproc_adl(raw, inarg):132 "Preprocess %% statements in ADL"133 134 return raw.replace("%%", inarg)135 136 90 def identifier(token): 137 91 "Check whether the token is an identifier" … … 171 125 return True 172 126 173 def parse_bp(base, root, inname, nested, outname, indent): 127 def preproc_bp(name, tokens): 128 "Preprocess tentative statements in Behavior Protocol" 129 130 result = [] 131 i = 0 132 133 while (i < len(tokens)): 134 if (tokens[i] == "tentative"): 135 if ((i + 1 < len(tokens)) and (tokens[i + 1] == "{")): 136 i += 2 137 start = i 138 level = 1 139 140 while ((i < len(tokens)) and (level > 0)): 141 if (tokens[i] == "{"): 142 level += 1 143 elif (tokens[i] == "}"): 144 level -= 1 145 146 i += 1 147 148 if (level == 0): 149 result.append("(") 150 result.extend(preproc_bp(name, tokens[start:(i - 1)])) 151 result.append(")") 152 result.append("+") 153 result.append("NULL") 154 if (i < len(tokens)): 155 result.append(tokens[i]) 156 else: 157 print "%s: Syntax error in tentative statement" % name 158 else: 159 print "%s: Unexpected token in tentative statement" % name 160 else: 161 result.append(tokens[i]) 162 163 i += 1 164 165 return result 166 167 def parse_bp(name, protocol, base_indent): 174 168 "Parse Behavior Protocol" 175 169 176 if (nested): 177 if (inname[0:1] == "/"): 178 path = os.path.join(base, ".%s" % inname) 179 nested_root = os.path.dirname(path) 180 else: 181 path = os.path.join(root, inname) 182 nested_root = root 183 184 if (not os.path.isfile(path)): 185 print "%s: Unable to include file %s" % (outname, path) 186 return "" 187 else: 188 path = inname 189 nested_root = root 190 191 inf = file(path, "r") 192 tokens = preproc_bp(outname, split_tokens(inf.read(), ["\n", " ", "\t", "(", ")", "{", "}", "[", "]", "/*", "*/", "#", "*", ";", "+", "||", "|", "!", "?"], True, True)) 193 170 tokens = preproc_bp(name, split_tokens(protocol, ["\n", " ", "\t", "(", ")", "{", "}", "*", ";", "+", "||", "|", "!", "?"], True, True)) 171 172 indent = base_indent 194 173 output = "" 195 inc = False196 comment = False197 lcomment = False198 174 199 175 for token in tokens: 200 if (comment):201 if (token == "*/"):202 comment = False203 continue204 205 if ((not comment) and (token == "/*")):206 comment = True207 continue208 209 if (lcomment):210 if (token == "\n"):211 lcomment = False212 continue213 214 if ((not lcomment) and (token == "#")):215 lcomment = True216 continue217 218 176 if (token == "\n"): 219 continue220 221 if (inc):222 output += "\n%s(" % tabs(indent)223 224 bp = parse_bp(base, nested_root, token, True, outname, indent + 1)225 if (bp.strip() == ""):226 output += "\n%sNULL" % tabs(indent + 1)227 else:228 output += bp229 230 output += "\n%s)" % tabs(indent)231 inc = False232 177 continue 233 178 234 179 if ((token == ";") or (token == "+") or (token == "||") or (token == "|")): 235 180 output += " %s" % token 236 elif (token == "["):237 inc = True238 elif (token == "]"):239 inc = False240 181 elif (token == "("): 241 182 output += "\n%s%s" % (tabs(indent), token) 242 183 indent += 1 243 184 elif (token == ")"): 244 if (indent < = 0):245 print "%s: Wrong number of parentheses" % outname185 if (indent < base_indent): 186 print "%s: Too many parentheses" % name 246 187 247 188 indent -= 1 … … 251 192 indent += 1 252 193 elif (token == "}"): 253 if (indent < = 0):254 print "%s: Wrong number of parentheses" % outname194 if (indent < base_indent): 195 print "%s: Too many parentheses" % name 255 196 256 197 indent -= 1 … … 263 204 output += "%s" % token 264 205 265 inf.close() 206 if (indent > base_indent): 207 print "%s: Missing parentheses" % name 208 209 output = output.strip() 210 if (output == ""): 211 return "NULL" 266 212 267 213 return output 214 215 def dump_iface_bp(interface, protocol, outdir): 216 "Dump Behavior Protocol of a given interface" 217 218 outname = os.path.join(outdir, "iface_%s.bp" % interface) 219 if (os.path.isfile(outname)): 220 print "%s: File already exists, overwriting" % outname 221 222 outf = file(outname, "w") 223 outf.write(parse_bp(outname, protocol, 0)) 224 outf.close() 225 226 def dump_frame_bp(frame, protocol, outdir): 227 "Dump Behavior Protocol of a given frame" 228 229 outname = os.path.join(outdir, "frame_%s.bp" % frame) 230 if (os.path.isfile(outname)): 231 print "%s: File already exists, overwriting" % outname 232 233 outf = file(outname, "w") 234 outf.write(parse_bp(outname, protocol, 0)) 235 outf.close() 236 237 def preproc_adl(raw, inarg): 238 "Preprocess %% statements in ADL" 239 240 return raw.replace("%%", inarg) 268 241 269 242 def parse_adl(base, root, inname, nested, indent): 270 243 "Parse Architecture Description Language" 244 245 global output 246 global context 247 global architecture 248 global interface 249 global frame 250 global protocol 251 global iface_protocols 252 global frame_protocols 271 253 272 254 if (nested): … … 297 279 raw = preproc_adl(inf.read(), inarg) 298 280 tokens = split_tokens(raw, ["\n", " ", "\t", "(", ")", "{", "}", "[", "]", "/*", "*/", "#", ";"], True, True) 299 output = ""300 281 301 282 for token in tokens: … … 305 286 if (INC in context): 306 287 context.remove(INC) 307 308 if (PROTOCOL in context): 309 protocol += parse_bp(base, nested_root, token, True, "xxx", indent).strip() 310 else: 311 output += "\n%s" % tabs(indent) 312 output += parse_adl(base, nested_root, token, True, indent).strip() 313 288 parse_adl(base, nested_root, token, True, indent) 314 289 context.add(POST_INC) 315 290 continue … … 319 294 print "%s: Expected ]" % inname 320 295 321 context.add(SEEN_NL)322 296 context.remove(POST_INC) 323 297 continue … … 351 325 continue 352 326 353 # Seen newline 354 355 if (SEEN_NL in context): 356 context.remove(SEEN_NL) 357 if (token == "\n"): 358 output += "\n%s" % tabs(indent) 359 continue 360 else: 361 if (token == "\n"): 362 continue 363 364 # "interface" 365 366 if (IFACE in context): 327 if (token == "\n"): 328 continue 329 330 # "frame" 331 332 if (FRAME in context): 367 333 if (NULL in context): 368 334 if (token != ";"): 369 print "%s: Expected ;" % inname335 print "%s: Expected ';' in frame '%s'" % (inname, frame) 370 336 else: 371 337 output += "%s\n" % token 372 338 373 339 context.remove(NULL) 374 context.remove( IFACE)375 interface = None340 context.remove(FRAME) 341 frame = None 376 342 continue 377 343 … … 383 349 indent -= 1 384 350 385 if (indent == 1): 386 output += protocol.strip() 351 if (indent == -1): 352 if (frame in frame_protocols): 353 print "%s: Protocol for frame '%s' already defined" % (inname, frame) 354 else: 355 frame_protocols[frame] = protocol 356 output += "\n%s" % tabs(2) 357 output += parse_bp(inname, protocol, 2) 387 358 protocol = None 388 359 389 360 output += "\n%s" % token 361 indent = 0 390 362 391 363 context.remove(PROTOCOL) … … 397 369 continue 398 370 399 if ( PROTOTYPEin context):371 if (REQUIRES in context): 400 372 if (FIN in context): 401 373 if (token != ";"): 402 print "%s: Expected ;" % inname374 print "%s: Expected ';' in frame '%s'" % (inname, frame) 403 375 else: 404 376 output += "%s" % token 405 377 406 378 context.remove(FIN) 407 context.remove(PROTOTYPE) 408 continue 409 410 if (PAR_RIGHT in context): 411 if (token == ")"): 412 output += "%s" % token 413 context.remove(PAR_RIGHT) 414 context.add(FIN) 415 else: 416 output += " %s" % token 417 418 continue 419 420 if (SIGNATURE in context): 421 output += "%s" % token 422 if (token == ")"): 423 context.remove(SIGNATURE) 424 context.add(FIN) 425 426 context.remove(SIGNATURE) 427 context.add(PAR_RIGHT) 428 continue 429 430 if (PAR_LEFT in context): 431 if (token != "("): 432 print "%s: Expected (" % inname 433 else: 434 output += "%s" % token 435 436 context.remove(PAR_LEFT) 437 context.add(SIGNATURE) 438 continue 439 440 if (not identifier(token)): 441 print "%s: Method identifier expected" % inname 442 else: 443 output += "%s" % token 444 445 context.add(PAR_LEFT) 446 continue 379 continue 380 381 if (VAR in context): 382 if (not identifier(token)): 383 print "%s: Instance name expected in frame '%s'" % (inname, frame) 384 else: 385 output += "%s" % token 386 387 context.remove(VAR) 388 context.add(FIN) 389 continue 390 391 if ((token == "}") or (token[-1] == ":")): 392 context.remove(REQUIRES) 393 else: 394 if (not identifier(token)): 395 print "%s: Interface name expected in frame '%s'" % (inname, frame) 396 else: 397 output += "\n%s%s " % (tabs(indent), token) 398 399 context.add(VAR) 400 continue 401 402 if (PROVIDES in context): 403 if (FIN in context): 404 if (token != ";"): 405 print "%s: Expected ';' in frame '%s'" % (inname, frame) 406 else: 407 output += "%s" % token 408 409 context.remove(FIN) 410 continue 411 412 if (VAR in context): 413 if (not identifier(token)): 414 print "%s: Instance name expected in frame '%s'" % (inname, frame) 415 else: 416 output += "%s" % token 417 418 context.remove(VAR) 419 context.add(FIN) 420 continue 421 422 if ((token == "}") or (token[-1] == ":")): 423 context.remove(PROVIDES) 424 else: 425 if (not identifier(token)): 426 print "%s: Interface name expected in frame '%s'" % (inname, frame) 427 else: 428 output += "\n%s%s " % (tabs(indent), token) 429 430 context.add(VAR) 431 continue 447 432 448 433 if (token == "}"): 449 if (indent != 1):450 print "%s: Wrong number of parentheses " % inname434 if (indent != 2): 435 print "%s: Wrong number of parentheses in frame '%s'" % (inname, frame) 451 436 else: 452 437 indent = 0 … … 457 442 continue 458 443 459 if (token == "ipcarg_t"): 460 output += "\n%s%s " % (tabs(indent), token) 461 context.add(PROTOTYPE) 444 if (token == "provides:"): 445 output += "\n%s%s" % (tabs(indent - 1), token) 446 context.add(PROVIDES) 447 protocol = "" 448 continue 449 450 if (token == "requires:"): 451 output += "\n%s%s" % (tabs(indent - 1), token) 452 context.add(REQUIRES) 453 protocol = "" 462 454 continue 463 455 464 456 if (token == "protocol:"): 465 457 output += "\n%s%s" % (tabs(indent - 1), token) 458 indent = 0 466 459 context.add(PROTOCOL) 467 460 protocol = "" 468 461 continue 469 462 470 print "%s: Unknown token %s in interface" % (inname, token)463 print "%s: Unknown token '%s' in frame '%s'" % (inname, token, frame) 471 464 continue 472 465 … … 482 475 output += "%s\n" % token 483 476 context.remove(HEAD) 477 context.remove(FRAME) 478 continue 479 480 print "%s: Unknown token '%s' in frame head '%s'" % (inname, token, frame) 481 482 continue 483 484 if (not identifier(token)): 485 print "%s: Expected frame name" % inname 486 else: 487 frame = token 488 output += "%s " % token 489 490 context.add(HEAD) 491 continue 492 493 # "interface" 494 495 if (IFACE in context): 496 if (NULL in context): 497 if (token != ";"): 498 print "%s: Expected ';' in interface '%s'" % (inname, interface) 499 else: 500 output += "%s\n" % token 501 502 context.remove(NULL) 503 context.remove(IFACE) 504 interface = None 505 continue 506 507 if (BODY in context): 508 if (PROTOCOL in context): 509 if (token == "{"): 510 indent += 1 511 elif (token == "}"): 512 indent -= 1 513 514 if (indent == -1): 515 if (interface in iface_protocols): 516 print "%s: Protocol for interface '%s' already defined" % (inname, interface) 517 else: 518 iface_protocols[interface] = protocol 519 520 output += "\n%s" % tabs(2) 521 output += parse_bp(inname, protocol, 2) 522 protocol = None 523 524 output += "\n%s" % token 525 indent = 0 526 527 context.remove(PROTOCOL) 528 context.remove(BODY) 529 context.add(NULL) 530 else: 531 protocol += token 532 533 continue 534 535 if (PROTOTYPE in context): 536 if (FIN in context): 537 if (token != ";"): 538 print "%s: Expected ';' in interface '%s'" % (inname, interface) 539 else: 540 output += "%s" % token 541 542 context.remove(FIN) 543 context.remove(PROTOTYPE) 544 continue 545 546 if (PAR_RIGHT in context): 547 if (token == ")"): 548 output += "%s" % token 549 context.remove(PAR_RIGHT) 550 context.add(FIN) 551 else: 552 output += " %s" % token 553 554 continue 555 556 if (SIGNATURE in context): 557 output += "%s" % token 558 if (token == ")"): 559 context.remove(SIGNATURE) 560 context.add(FIN) 561 562 context.remove(SIGNATURE) 563 context.add(PAR_RIGHT) 564 continue 565 566 if (PAR_LEFT in context): 567 if (token != "("): 568 print "%s: Expected '(' in interface '%s'" % (inname, interface) 569 else: 570 output += "%s" % token 571 572 context.remove(PAR_LEFT) 573 context.add(SIGNATURE) 574 continue 575 576 if (not identifier(token)): 577 print "%s: Method identifier expected in interface '%s'" % (inname, interface) 578 else: 579 output += "%s" % token 580 581 context.add(PAR_LEFT) 582 continue 583 584 if (token == "}"): 585 if (indent != 2): 586 print "%s: Wrong number of parentheses in interface '%s'" % (inname, interface) 587 else: 588 indent = 0 589 output += "\n%s" % token 590 591 context.remove(BODY) 592 context.add(NULL) 593 continue 594 595 if ((token == "ipcarg_t") or (token == "unative_t")): 596 output += "\n%s%s " % (tabs(indent), token) 597 context.add(PROTOTYPE) 598 continue 599 600 if (token == "protocol:"): 601 output += "\n%s%s" % (tabs(indent - 1), token) 602 indent = 0 603 context.add(PROTOCOL) 604 protocol = "" 605 continue 606 607 print "%s: Unknown token '%s' in interface '%s'" % (inname, token, interface) 608 continue 609 610 if (HEAD in context): 611 if (token == "{"): 612 output += "%s" % token 613 indent += 2 614 context.remove(HEAD) 615 context.add(BODY) 616 continue 617 618 if (token == ";"): 619 output += "%s\n" % token 620 context.remove(HEAD) 484 621 context.remove(ARCH) 485 context.discard(SYSTEM)486 622 continue 487 623 488 624 if (not word(token)): 489 print "%s: Expected word " % inname625 print "%s: Expected word in interface head '%s'" % (inname, interface) 490 626 else: 491 627 output += "%s " % token … … 507 643 if (NULL in context): 508 644 if (token != ";"): 509 print "%s: Expected ;" % inname645 print "%s: Expected ';' in architecture '%s'" % (inname, architecture) 510 646 else: 511 647 output += "%s\n" % token … … 518 654 519 655 if (BODY in context): 656 if (DELEGATE in context): 657 if (FIN in context): 658 if (token != ";"): 659 print "%s: Expected ';' in architecture '%s'" % (inname, architecture) 660 else: 661 output += "%s" % token 662 663 context.remove(FIN) 664 context.remove(DELEGATE) 665 continue 666 667 if (VAR in context): 668 if (not descriptor(token)): 669 print "%s: Expected interface descriptor in architecture '%s'" % (inname, architecture) 670 else: 671 output += "%s" % token 672 673 context.add(FIN) 674 context.remove(VAR) 675 continue 676 677 if (TO in context): 678 if (token != "to"): 679 print "%s: Expected 'to' in architecture '%s'" % (inname, architecture) 680 else: 681 output += "%s " % token 682 683 context.add(VAR) 684 context.remove(TO) 685 continue 686 687 if (not identifier(token)): 688 print "%s: Expected interface name in architecture '%s'" % (inname, architecture) 689 else: 690 output += "%s " % token 691 692 context.add(TO) 693 continue 694 695 if (SUBSUME in context): 696 if (FIN in context): 697 if (token != ";"): 698 print "%s: Expected ';' in architecture '%s'" % (inname, architecture) 699 else: 700 output += "%s" % token 701 702 context.remove(FIN) 703 context.remove(SUBSUME) 704 continue 705 706 if (VAR in context): 707 if (not identifier(token)): 708 print "%s: Expected interface name in architecture '%s'" % (inname, architecture) 709 else: 710 output += "%s" % token 711 712 context.add(FIN) 713 context.remove(VAR) 714 continue 715 716 if (TO in context): 717 if (token != "to"): 718 print "%s: Expected 'to' in architecture '%s'" % (inname, architecture) 719 else: 720 output += "%s " % token 721 722 context.add(VAR) 723 context.remove(TO) 724 continue 725 726 if (not descriptor(token)): 727 print "%s: Expected interface descriptor in architecture '%s'" % (inname, architecture) 728 else: 729 output += "%s " % token 730 731 context.add(TO) 732 continue 733 520 734 if (BIND in context): 521 735 if (FIN in context): 522 736 if (token != ";"): 523 print "%s: Expected ;" % inname737 print "%s: Expected ';' in architecture '%s'" % (inname, architecture) 524 738 else: 525 739 output += "%s" % token … … 531 745 if (VAR in context): 532 746 if (not descriptor(token)): 533 print "%s: Expected second interface descriptor " % inname747 print "%s: Expected second interface descriptor in architecture '%s'" % (inname, architecture) 534 748 else: 535 749 output += "%s" % token … … 541 755 if (TO in context): 542 756 if (token != "to"): 543 print "%s: Expected to" % inname757 print "%s: Expected 'to' in architecture '%s'" % (inname, architecture) 544 758 else: 545 759 output += "%s " % token … … 550 764 551 765 if (not descriptor(token)): 552 print "%s: Expected interface descriptor " % inname766 print "%s: Expected interface descriptor in architecture '%s'" % (inname, architecture) 553 767 else: 554 768 output += "%s " % token … … 560 774 if (FIN in context): 561 775 if (token != ";"): 562 print "%s: Expected ;" % inname776 print "%s: Expected ';' in architecture '%s'" % (inname, architecture) 563 777 else: 564 778 output += "%s" % token … … 570 784 if (VAR in context): 571 785 if (not identifier(token)): 572 print "%s: Expected instance name " % inname786 print "%s: Expected instance name in architecture '%s'" % (inname, architecture) 573 787 else: 574 788 output += "%s" % token … … 579 793 580 794 if (not identifier(token)): 581 print "%s: Expected frame/architecture type " % inname795 print "%s: Expected frame/architecture type in architecture '%s'" % (inname, architecture) 582 796 else: 583 797 output += "%s " % token … … 588 802 if (token == "}"): 589 803 if (indent != 1): 590 print "%s: Wrong number of parentheses " % inname804 print "%s: Wrong number of parentheses in architecture '%s'" % (inname, architecture) 591 805 else: 592 806 indent -= 1 … … 607 821 continue 608 822 609 print "%s: Unknown token %s in architecture" % (inname, token) 823 if (token == "subsume"): 824 output += "\n%s%s " % (tabs(indent), token) 825 context.add(SUBSUME) 826 continue 827 828 if (token == "delegate"): 829 output += "\n%s%s " % (tabs(indent), token) 830 context.add(DELEGATE) 831 continue 832 833 print "%s: Unknown token '%s' in architecture '%s'" % (inname, token, architecture) 610 834 continue 611 835 … … 626 850 627 851 if (not word(token)): 628 print "%s: Expected word " % inname852 print "%s: Expected word in architecture head '%s'" % (inname, architecture) 629 853 else: 630 854 output += "%s " % token … … 645 869 if (SYSTEM in context): 646 870 if (token != "architecture"): 647 print "%s: Expected architecture" % inname871 print "%s: Expected 'architecture'" % inname 648 872 else: 649 873 output += "%s " % token 650 874 651 875 context.add(ARCH) 876 continue 877 878 if (token == "frame"): 879 output += "\n%s " % token 880 context.add(FRAME) 652 881 continue 653 882 … … 667 896 continue 668 897 669 print "%s: Unknown token %s" % (inname, token)898 print "%s: Unknown token '%s'" % (inname, token) 670 899 671 900 inf.close() 672 673 return output 674 675 def open_adl(base, root, inname, outname): 901 902 def open_adl(base, root, inname, outdir, outname): 676 903 "Open Architecture Description file" 677 904 678 context.clear() 905 global output 906 global context 907 global architecture 908 global interface 909 global frame 910 global protocol 911 912 output = "" 913 context = set() 914 architecture = None 679 915 interface = None 680 architecture = None916 frame = None 681 917 protocol = None 682 918 683 adl = parse_adl(base, root, inname, False, 0) 684 if (adl.strip() == ""): 685 adl = "/* Empty */\n" 686 687 if (os.path.isfile(outname)): 688 print "%s: File already exists, overwriting" % outname 689 690 outf = file(outname, "w") 691 outf.write(adl.strip()) 692 outf.close() 919 parse_adl(base, root, inname, False, 0) 920 output = output.strip() 921 922 if (output != ""): 923 if (os.path.isfile(outname)): 924 print "%s: File already exists, overwriting" % outname 925 926 outf = file(outname, "w") 927 outf.write(output) 928 outf.close() 929 else: 930 if (os.path.isfile(outname)): 931 print "%s: File already exists, but should be empty" % outname 693 932 694 933 def recursion(base, root, output, level): … … 704 943 if (fcomp[-1] == ".adl"): 705 944 output_path = os.path.join(output, cname[-1]) 706 open_adl(base, root, canon, output _path)945 open_adl(base, root, canon, output, output_path) 707 946 708 947 if (os.path.isdir(canon)): … … 710 949 711 950 def main(): 951 global iface_protocols 952 global frame_protocols 953 712 954 if (len(sys.argv) < 2): 713 955 usage(sys.argv[0]) … … 719 961 return 720 962 963 iface_protocols = {} 964 frame_protocols = {} 965 721 966 recursion(".", ".", path, 0) 967 968 for key, value in iface_protocols.items(): 969 dump_iface_bp(key, value, path) 970 971 for key, value in frame_protocols.items(): 972 dump_frame_bp(key, value, path) 722 973 723 974 if __name__ == '__main__':
Note:
See TracChangeset
for help on using the changeset viewer.