def get(self, bundle): if not bundle.endswith(os.sep): bundle += os.sep result = [] for plugin in get_all_plugins(): if bundle in plugin['bundles']: result.append(plugin) self.set_header('Content-Type', 'application/json') self.write(json.dumps(result))
def prepare(): def run_server(): application.listen(DEVICE_WEBSERVER_PORT, address="0.0.0.0") if LOG: tornado.log.enable_pretty_logging() def check(): if SESSION.host.sock is None: print("Host failed to initialize, is ingen running?") sys.exit(1) check_environment() lv2_init() if not APP: print("Scanning plugins, this may take a little...") get_all_plugins() print("Done!") run_server() tornado.ioloop.IOLoop.instance().add_callback(check)
def get(self): data = get_all_plugins() self.set_header('Content-Type', 'application/json') self.write(json.dumps(data))
def list(self): return get_all_plugins()