(jsfile, plugin, plugin_location=None)
Writes the "tiki.register" line for a plugin to a file. If
    "plugin_location" is specified, this describes a dynamic plugin that will
    be fetched from that URL. Otherwise, this "tiki.register" line describes
    a plugin defined within "jsfile".
Writes the "tiki.register" line for a plugin to a file. If
    "plugin_location" is specified, this describes a dynamic plugin that will
    be fetched from that URL. Otherwise, this "tiki.register" line describes
    a plugin defined within "jsfile".
Writes the tiki . register line for a plugin to a file . If plugin_location is specified this describes a dynamic plugin that will be fetched from that URL . Otherwise this tiki . register line describes a plugin defined within jsfile .
def write_metadata(jsfile, plugin, plugin_location=None):
    """Writes the "tiki.register" line for a plugin to a file. If
    "plugin_location" is specified, this describes a dynamic plugin that will
    be fetched from that URL. Otherwise, this "tiki.register" line describes
    a plugin defined within "jsfile"."""
    name, deps = plugin.name, plugin.dependencies

    jsfilename = name + ".js"
    deps_js = ", ".join([ '%s: "0.0.0"' % dumps(dep) for dep in deps ])

    if plugin_location is None:
        resources_js = ""
    else:
        resources_js = """,
    'tiki:resources': [
        {
            url: bespin.base + %s,
            type: 'script',
            id: %s,
            name: %s
        }
    ]""" \
            % (dumps(plugin_location), dumps(jsfilename), dumps(jsfilename))


    jsfile.write(""";bespin.tiki.register(%s, {
    name: %s,
    dependencies: { %s }%s
});""" \
        % (dumps("::"+name), dumps(name), deps_js, resources_js))

    # Hack so that web workers can determine whether they need to load the boot
    # plugin metadata.
    if name == "bespin":
        jsfile.write("""bespin.bootLoaded = true;""");
def write_metadata ( jsfile , plugin , plugin_location = None ) : name , deps = plugin . name , plugin . dependencies jsfilename = name + ".js" deps_js = ", " . join ( [ '%s: "0.0.0"' % dumps ( dep ) for dep in deps ] ) if plugin_location is None : resources_js = "" else : resources_js = """,
    'tiki:resources': [
        {
            url: bespin.base + %s,
            type: 'script',
            id: %s,
            name: %s
        }
    ]""" % ( dumps ( plugin_location ) , dumps ( jsfilename ) , dumps ( jsfilename ) ) jsfile . write ( """;bespin.tiki.register(%s, {
    name: %s,
    dependencies: { %s }%s
});""" % ( dumps ( "::" + name ) , dumps ( name ) , deps_js , resources_js ) ) # Hack so that web workers can determine whether they need to load the boot # plugin metadata. if name == "bespin" : jsfile . write ( """bespin.bootLoaded = true;""" )