Esempio n. 1
0
 def _get_shared_commands_for_file(self, file):
     commands = []
     module_name = loader._get_module_name(file)
     module = importlib.import_module(module_name)
     for name in dir(module):
         obj = getattr(module, name)
         if isinstance(obj, (type, types.ClassType)) and issubclass(obj, cdp.Command):
             commands.append(obj)
     return commands
Esempio n. 2
0
    def run(self, build_path):
        files = [x for x in loader.locate("entrypoint.js")]
        css_deps, js_deps = calculate_deps(files[0])

        file = open("%s/%s" % (build_path, "generated/index.html"), "w")
        vars = {
            "entrypoint": loader._get_module_name(files[0]),
            "js_deps": ["/generated/client/compiled.js"],
            "css_deps": css_deps,
        }
        file.write(template.render("%stic/web/templates/index_compiled.html" % loader.root_path(), vars))