670 |
670 |
671 def main(): |
671 def main(): |
672 global app_platforms |
672 global app_platforms |
673 |
673 |
674 parser = OptionParser(usage=usage, version=version) |
674 parser = OptionParser(usage=usage, version=version) |
675 parser.add_option("-o", "--output", dest="output", |
675 parser.add_option("-o", |
676 help="directory to which the webapp should be written") |
676 "--output", |
677 parser.add_option("-j", "--include-js", dest="js_includes", action="append", |
677 dest="output", |
678 help="javascripts to load into the same frame as the rest of the script") |
678 help="directory to which the webapp should be written" |
679 parser.add_option("-I", "--library_dir", dest="library_dirs", |
679 ) |
680 action="append", help="additional paths appended to PYJSPATH") |
680 parser.add_option("-j", |
681 parser.add_option("-D", "--data_dir", dest="data_dir", |
681 "--include-js", |
682 help="path for data directory") |
682 dest="js_includes", |
683 parser.add_option("-m", "--dynamic-modules", action="store_true", |
683 action="append", |
684 dest="dynamic", default=False, |
684 help="javascripts to load into the same frame as the rest of the script" |
685 help="Split output into separate dynamically-loaded modules (experimental)") |
685 ) |
686 parser.add_option("-P", "--platforms", dest="platforms", |
686 parser.add_option("-I", |
687 help="platforms to build for, comma-separated") |
687 "--library_dir", |
688 parser.add_option("-d", "--debug", action="store_true", dest="debug") |
688 dest="library_dirs", |
689 parser.add_option("-O", "--optimize", action="store_true", |
689 action="append", |
690 dest="optimize", default=False, |
690 help="additional paths appended to PYJSPATH" |
|
691 ) |
|
692 parser.add_option("-D", |
|
693 "--data_dir", |
|
694 dest="data_dir", |
|
695 help="path for data directory" |
|
696 ) |
|
697 parser.add_option("-m", |
|
698 "--dynamic-modules", |
|
699 action="store_true", |
|
700 dest="dynamic", |
|
701 default=False, |
|
702 help="Split output into separate dynamically-loaded modules (experimental)" |
|
703 ) |
|
704 parser.add_option("-P", |
|
705 "--platforms", |
|
706 dest="platforms", |
|
707 help="platforms to build for, comma-separated" |
|
708 ) |
|
709 parser.add_option("-d", |
|
710 "--debug", |
|
711 action="store_true", |
|
712 dest="debug" |
|
713 ) |
|
714 parser.add_option("-O", |
|
715 "--optimize", |
|
716 action="store_true", |
|
717 dest="optimize", |
|
718 default=False, |
691 help="Optimize generated code (removes all print statements)", |
719 help="Optimize generated code (removes all print statements)", |
692 ) |
720 ) |
693 parser.add_option("-c", "--cache_buster", action="store_true", |
721 parser.add_option("-c", |
694 dest="cache_buster", |
722 "--cache_buster", |
695 help="Enable browser cache-busting (MD5 hash added to output filenames)") |
723 action="store_true", |
|
724 dest="cache_buster", |
|
725 help="Enable browser cache-busting (MD5 hash added to output filenames)" |
|
726 ) |
696 |
727 |
697 parser.set_defaults(output="output", js_includes=[], library_dirs=[], |
728 parser.set_defaults(output="output", js_includes=[], library_dirs=[], |
698 platforms=(','.join(app_platforms)), |
729 platforms=(','.join(app_platforms)), |
699 data_dir=os.path.join(sys.prefix, "share/pyjamas"), |
730 data_dir=os.path.join(sys.prefix, "share/pyjamas"), |
700 dynamic=False, |
731 dynamic=False, |