svgui/pyjs/build.py
changeset 2431 6923074540dd
parent 2418 5587c490a070
child 2439 f0a040f1de1b
equal deleted inserted replaced
2427:9554952d36d7 2431:6923074540dd
     8 import re
     8 import re
     9 import os
     9 import os
    10 from os.path import join, basename, abspath, split, isfile, isdir
    10 from os.path import join, basename, abspath, split, isfile, isdir
    11 from hashlib import md5
    11 from hashlib import md5
    12 from optparse import OptionParser
    12 from optparse import OptionParser
    13 from cStringIO import StringIO
    13 from six.moves import cStringIO
    14 
    14 
    15 from svgui.pyjs import pyjs
    15 from svgui.pyjs import pyjs
    16 
    16 
    17 
    17 
    18 usage = """
    18 usage = """
   252     home_nocache_html_output = open(join(output, app_name + ".nocache.html"),
   252     home_nocache_html_output = open(join(output, app_name + ".nocache.html"),
   253                                     "w")
   253                                     "w")
   254 
   254 
   255     # the selector templ is added to the selectScript function
   255     # the selector templ is added to the selectScript function
   256     select_tmpl = """O(["true","%s"],"%s");"""
   256     select_tmpl = """O(["true","%s"],"%s");"""
   257     script_selectors = StringIO()
   257     script_selectors = cStringIO()
   258 
   258 
   259     for platform, file_prefix in app_files:
   259     for platform, file_prefix in app_files:
   260         print(select_tmpl % (platform, file_prefix), file=script_selectors)
   260         print(select_tmpl % (platform, file_prefix), file=script_selectors)
   261 
   261 
   262     print(
   262     print(
   451             overnames = "new pyjslib.Dict({\n\t\t%s\n\t})" % ',\n\t\t'.join(overnames)
   451             overnames = "new pyjslib.Dict({\n\t\t%s\n\t})" % ',\n\t\t'.join(overnames)
   452 
   452 
   453             if dynamic:
   453             if dynamic:
   454                 mod_cache_html_output = open(join(output, mod_cache_name), "w")
   454                 mod_cache_html_output = open(join(output, mod_cache_name), "w")
   455             else:
   455             else:
   456                 mod_cache_html_output = StringIO()
   456                 mod_cache_html_output = cStringIO()
   457 
   457 
   458             print(mod_cache_html_template % dict(
   458             print(mod_cache_html_template % dict(
   459                 mod_name=mod_name,
   459                 mod_name=mod_name,
   460                 app_name=app_name,
   460                 app_name=app_name,
   461                 modnames=modnames,
   461                 modnames=modnames,