def komodo_to_cix(output_path, p4_edit=False): print "komodo_to_cix `%s'" % output_path cix_komodo = createCixRoot(name="Komodo", description="Komodo JavaScript API - version %s" % komodo_js_api_version) # cix_yui_file = createCixFile(cix_yui, "yui", lang="JavaScript") # cix_yui_module = createCixModule(cix_yui_file, "*", lang="JavaScript") # We use one JavaScript ciler instance for all the files we scan. This is # so we can record all variable/function/etc... information into one # komodo.cix file. mgr = Manager() jscile = JavaScriptCiler(mgr, "komodo") xtk_chrome_dir = join(_get_komodo_dev_dir(), "src", "chrome", "xtk", "content") komodo_chrome_dir = join(_get_komodo_dev_dir(), "build", "release", "chrome", "komodo", "content") for path in _gen_komodo_js_api_files([xtk_chrome_dir, komodo_chrome_dir]): # if path in ("utilities.js", "yahoo-dom-event.js"): # # This is just a compressed up version of multiple files # continue log.info("scanning `%s'" % path) try: # Slight hack to ensure the current filename stays correct for # cile logging. jscile.cile.name = path jscile.scan_puretext(file(path).read(), updateAllScopeNames=False) except Exception, e: # Report the file that had problems scanning. print "komodo_to_cix:: failed, exception scanning: %r, " \ "near line: %r" % (path, jscile.lineno) raise
def main(cix_filename, updatePerforce=False): cix_yui = createCixRoot(name="YUI-%s" % (yui_major_minor_version, ), description="Yahoo! User Interface Library - v%s" % (yui_version)) #cix_yui_file = createCixFile(cix_yui, "yui", lang="JavaScript") #cix_yui_module = createCixModule(cix_yui_file, "*", lang="JavaScript") files = getYUIFilesFromWebpage() jscile = JavaScriptCiler(Manager(), "yui") for filename, content in files.items(): if filename in ("utilities.js", "yahoo-dom-event.js", # v2.2.0 "yahoo-event-dom.js", "yuiloader-dom-event.js"): # v2.7.0 # This is just a compressed up version of multiple files continue print "filename: %r" % (filename) jscile.path = filename jscile.scan_puretext(content, updateAllScopeNames=False) print "updating scope names" jscile.cile.updateAllScopeNames() # Convert the Javascript to CIX, content goes into cix element #jscile.toElementTree(cix) print "converting to cix" jscile.convertToElementTreeFile(cix_yui, "JavaScript") #mergeElementTreeScopes(cix_yui_module) #remove_cix_line_numbers_from_tree(cix_yui) # Write out the tree print "writing cix" updateCix(cix_filename, get_cix_string(cix_yui), updatePerforce) print "done"
def main(cix_filename, toolkit_jar_file, updatePerforce=False): cix_komodo = createCixRoot(name="Mozilla Toolkit", description="Mozilla Toolkit API - version 1.8") #cix_yui_file = createCixFile(cix_yui, "yui", lang="JavaScript") #cix_yui_module = createCixModule(cix_yui_file, "*", lang="JavaScript") print "cix_filename: %r" % (cix_filename, ) filenames_and_content = getMozillaToolkitFilenamesAndContent(toolkit_jar_file) jscile = JavaScriptCiler(Manager(), "Mozilla Toolkit") for filename, content in filenames_and_content.items(): jscile.scan_puretext(content) jscile.convertToElementTreeFile(cix_komodo, "JavaScript") #mergeElementTreeScopes(cix_yui_module) #remove_cix_line_numbers_from_tree(cix_komodo) #remove_private_elements(cix_komodo) # Write out the tree updateCix(cix_filename, get_cix_string(cix_komodo), updatePerforce)
def main(cix_filename): cix = createCixRoot(name="%s_%s" % (library_name, library_version.replace(".", "")), description="%s JavaScript framework - version %s" % (library_name, library_version)) files = getFilesFromWebpage() jscile = JavaScriptCiler(Manager(), "extjs") for path, (dirname, filename, content) in files["source"].items(): dir_split = dirname.split("/") if ("source" in dir_split and not filename.startswith("ext-lang-")) or \ ("src" in dir_split and not "adapter" in dir_split): print "filename: %r" % (filename) jscile.path = filename jscile.scan_puretext(content.decode("utf-8"), updateAllScopeNames=False) jscile.cile.updateAllScopeNames() jscile.cile.name = "%s_%s" % (library_name.lower(), library_version.replace(".", "")) # Convert the Javascript to CIX, content goes into cix element jscile.convertToElementTreeFile(cix, "JavaScript") # Write out the tree updateCix(cix_filename, get_cix_string(cix))
def main(cix_filename, toolkit_jar_file, updatePerforce=False): cix_komodo = createCixRoot(name="Mozilla Toolkit", description="Mozilla Toolkit API - version 1.8") #cix_yui_file = createCixFile(cix_yui, "yui", lang="JavaScript") #cix_yui_module = createCixModule(cix_yui_file, "*", lang="JavaScript") print "cix_filename: %r" % (cix_filename, ) filenames_and_content = getMozillaToolkitFilenamesAndContent( toolkit_jar_file) jscile = JavaScriptCiler(Manager(), "Mozilla Toolkit") for filename, content in filenames_and_content.items(): jscile.scan_puretext(content) jscile.convertToElementTreeFile(cix_komodo, "JavaScript") #mergeElementTreeScopes(cix_yui_module) #remove_cix_line_numbers_from_tree(cix_komodo) #remove_private_elements(cix_komodo) # Write out the tree updateCix(cix_filename, get_cix_string(cix_komodo), updatePerforce)
def main(cix_filename): cix = createCixRoot(name="%s_%s" % (library_name, library_version.replace(".", "")), description="%s JavaScript framework - version %s" % ( library_name, library_version)) files = getFilesFromWebpage() jscile = JavaScriptCiler(Manager(), "extjs") for path, (dirname, filename, content) in files["source"].items(): dir_split = dirname.split("/") if ("source" in dir_split and not filename.startswith("ext-lang-")) or \ ("src" in dir_split and not "adapter" in dir_split): print "filename: %r" % (filename) jscile.path = filename jscile.scan_puretext(content.decode("utf-8"), updateAllScopeNames=False) jscile.cile.updateAllScopeNames() jscile.cile.name = "%s_%s" % (library_name.lower(), library_version.replace(".", "")) # Convert the Javascript to CIX, content goes into cix element jscile.convertToElementTreeFile(cix, "JavaScript") # Write out the tree updateCix(cix_filename, get_cix_string(cix))