def index(self): context = {} with open(DEFAULT_ICON_TEMPLATE) as fd: default_icon_template = tornado.escape.squeeze(fd.read().replace("'", "\\'")) with open(DEFAULT_SETTINGS_TEMPLATE) as fd: default_settings_template = tornado.escape.squeeze(fd.read().replace("'", "\\'")) context = { 'default_icon_template': default_icon_template, 'default_settings_template': default_settings_template, 'cloud_url': CLOUD_HTTP_ADDRESS, 'hardware_profile': b64encode(json.dumps(get_hardware()).encode("utf-8")), 'max_screenshot_width': MAX_SCREENSHOT_WIDTH, 'max_screenshot_height': MAX_SCREENSHOT_HEIGHT, 'package_server_address': PACKAGE_SERVER_ADDRESS or '', 'default_package_server_port': DEFAULT_PACKAGE_SERVER_PORT, 'package_repository': PACKAGE_REPOSITORY, 'js_custom_channel': 'true' if JS_CUSTOM_CHANNEL else 'false', 'auto_cloud_backup': 'true' if AUTO_CLOUD_BACKUP else 'false', 'avatar_url': AVATAR_URL, 'version': self.get_argument('v'), } return context
def index(self): context = {} ei = indexing.EffectIndex() default_icon_template = open(DEFAULT_ICON_TEMPLATE).read() default_settings_template = open(DEFAULT_SETTINGS_TEMPLATE).read() context = { 'effects': ei.every(), 'default_icon_template': tornado.escape.squeeze(default_icon_template.replace("'", "\\'")), 'default_settings_template': tornado.escape.squeeze(default_settings_template.replace("'", "\\'")), 'cloud_url': CLOUD_HTTP_ADDRESS, 'hardware_profile': b64encode(json.dumps(get_hardware())), # 'current_pedalboard': b64encode(json.dumps(SESSION.serialize_pedalboard(), default=json_handler)), 'max_screenshot_width': MAX_SCREENSHOT_WIDTH, 'max_screenshot_height': MAX_SCREENSHOT_HEIGHT, 'package_server_address': PACKAGE_SERVER_ADDRESS or '', 'default_package_server_port': DEFAULT_PACKAGE_SERVER_PORT, 'package_repository': PACKAGE_REPOSITORY, 'js_custom_channel': 'true' if JS_CUSTOM_CHANNEL else 'false', 'auto_cloud_backup': 'true' if AUTO_CLOUD_BACKUP else 'false', 'avatar_url': AVATAR_URL, 'version': self.get_argument('v'), } return context
def get(self): hardware = get_hardware() self.set_header('Content-Type', 'application/json') self.write(json.dumps(hardware))
def init_addressings(self): hw = set([ tuple(h[:4]) for sublist in get_hardware().values() for h in sublist ]) self.addressings = dict( (k, {'idx': 0, 'addrs': []}) for k in hw )
def init_addressings(self): hw = set([ tuple(h[:4]) for sublist in get_hardware().values() for h in sublist ]) self.addressings = dict((k, {'idx': 0, 'addrs': []}) for k in hw)