Example #1
0
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"
Example #2
0
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))
Example #3
0
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))