def _get_default_template_vars(self): signals = json.dumps(self.signals) return { 'page_name': self.name, 'signals': signals, 'top_level_tabs': self._top_level_tabs }
def _get_default_template_vars(self): signals = json.dumps(self.signals) checked_items = self.get_checks_info() tpl_vars = super()._get_default_template_vars() tpl_vars.update({'signals': signals, 'checked_items': checked_items}) return tpl_vars
def _get_default_template_vars(self): signals = json.dumps(self.signals) tpl_vars = super()._get_default_template_vars() tpl_vars.update({ 'signals': signals, 'tabs': self.tabs, 'locations': self.locations_items, 'show_all_locations': self._pages_data.location.show_all_locations, 'list_items': [], 'keyboard_layouts': self.keyboard_layouts, 'timezone_map_enabled': self.timezone_map_enabled }) return tpl_vars
def emit_js(self, cmd, *args): """ Pass data to a JavaScript handler in the web_view. Args: cmd (str): The name of the JavaScript function to call. *args (str): Arguments to pass to the function (optional). """ if cmd not in self._allowed_signals: self.logger.error('Signal: %s is not allowed!', cmd) return cmd = cmd.replace('-', '_') msg = json.dumps(dict(cmd=cmd, args=list(args))) var = self._generate_js_temp_variable_name() msg = self._emit_js_tpl.format(var, msg) self._web_view.run_javascript(msg, None, None, None)
def _get_default_template_vars(self): signals = json.dumps(self.signals) tpl_vars = super()._get_default_template_vars() tpl_vars.update({'signals': signals}) return tpl_vars
def _get_default_template_vars(self): signals = json.dumps(self.signals) return {'page_name': self.name, 'signals': signals, 'top_level_tabs': self._top_level_tabs}