MCPcopy Index your code
hub / github.com/rawpython/remi / query_client

Method query_client

remi/gui.py:1195–1216  ·  view source on GitHub ↗

WARNING: this is a new feature, subject to changes. This method allows to query client rendering attributes and style properties of a widget. The user, in order to get back the values must register a listener for the event 'onquery_client_result'. Arg

(self, app_instance, attribute_list, style_property_list)

Source from the content-addressed store, hash-verified

1193
1194
1195 def query_client(self, app_instance, attribute_list, style_property_list):
1196 """
1197 WARNING: this is a new feature, subject to changes.
1198 This method allows to query client rendering attributes and style properties of a widget.
1199 The user, in order to get back the values must register a listener for the event 'onquery_client_result'.
1200 Args:
1201 app_instance (App): the app instance
1202 attribute_list (list): list of attributes names
1203 style_property_list (list): list of style property names
1204 """
1205 app_instance.execute_javascript("""
1206 var params={};
1207 %(attributes)s
1208 %(style)s
1209 remi.sendCallbackParam('%(emitter_identifier)s','%(callback_name)s',params);
1210 """ % {
1211 'attributes': ";".join(map(lambda param_name: "params['%(param_name)s']=document.getElementById('%(emitter_identifier)s').%(param_name)s" % {'param_name': param_name, 'emitter_identifier': str(self.identifier)}, attribute_list)),
1212 'style': ";".join(map(lambda param_name: "params['%(param_name)s']=document.getElementById('%(emitter_identifier)s').style.%(param_name)s" % {'param_name': param_name, 'emitter_identifier': str(self.identifier)}, style_property_list)),
1213 'emitter_identifier': str(self.identifier),
1214 'callback_name': 'onquery_client_result'
1215 }
1216 )
1217
1218 @decorate_set_on_listener("(self, emitter, values_dictionary)")
1219 @decorate_event

Callers 1

onpageshowMethod · 0.80

Calls 1

execute_javascriptMethod · 0.80

Tested by

no test coverage detected