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