2222import time
2323import pkg_resources
2424
25-
2625# from typing import List, Any, Union, Tuple, Dict # For doing types in comments. perhaps not required
2726
2827
@@ -524,28 +523,24 @@ def Get(self):
524523
525524 class TextInput_raw_onkeyup (remi .gui .TextInput ):
526525 @remi .gui .decorate_set_on_listener ('(self, emitter, key, keycode, ctrl, shift, alt)' )
527- @remi .gui .decorate_event_js (
528- """var params={};params['key']=event.key;
526+ @remi .gui .decorate_event_js ("""var params={};params['key']=event.key;
529527 params['keycode']=(event.which||event.keyCode);
530528 params['ctrl']=event.ctrlKey;
531529 params['shift']=event.shiftKey;
532530 params['alt']=event.altKey;
533531 sendCallbackParam('%(emitter_identifier)s','%(event_name)s',params);
534- event.stopPropagation();event.preventDefault();return false;"""
535- )
532+ event.stopPropagation();event.preventDefault();return false;""" )
536533 def onkeyup (self , key , keycode , ctrl , shift , alt ):
537534 return (key , keycode , ctrl , shift , alt )
538535
539536 @remi .gui .decorate_set_on_listener ('(self, emitter, key, keycode, ctrl, shift, alt)' )
540- @remi .gui .decorate_event_js (
541- """var params={};params['key']=event.key;
537+ @remi .gui .decorate_event_js ("""var params={};params['key']=event.key;
542538 params['keycode']=(event.which||event.keyCode);
543539 params['ctrl']=event.ctrlKey;
544540 params['shift']=event.shiftKey;
545541 params['alt']=event.altKey;
546542 sendCallbackParam('%(emitter_identifier)s','%(event_name)s',params);
547- event.stopPropagation();event.preventDefault();return false;"""
548- )
543+ event.stopPropagation();event.preventDefault();return false;""" )
549544 def onkeydown (self , key , keycode , ctrl , shift , alt ):
550545 return (key , keycode , ctrl , shift , alt )
551546
@@ -1992,8 +1987,7 @@ def refresh(self):
19921987 i = int (time .time () * 1e6 )
19931988 # self.app_instance.execute_javascript("""
19941989 if Window .App is not None :
1995- Window .App .execute_javascript (
1996- """
1990+ Window .App .execute_javascript ("""
19971991 var url = '/%(id)s/get_image_data?update_index=%(frame_index)s';
19981992 var xhr = new XMLHttpRequest();
19991993 xhr.open('GET', url, true);
@@ -2004,9 +1998,7 @@ def refresh(self):
20041998 document.getElementById('%(id)s').src = imageUrl;
20051999 }
20062000 xhr.send();
2007- """
2008- % {'id' : id (self ), 'frame_index' : i }
2009- )
2001+ """ % {'id' : id (self ), 'frame_index' : i })
20102002
20112003 def get_image_data (self , update_index ):
20122004 headers = {'Content-type' : self .mimetype if self .mimetype else 'application/octet-stream' }
@@ -2497,7 +2489,7 @@ def Layout(self, rows):
24972489 self .AddRow (* row )
24982490
24992491 def _GetElementAtLocation (self , location ):
2500- ( row_num , col_num ) = location
2492+ row_num , col_num = location
25012493 row = self .Rows [row_num ]
25022494 element = row [col_num ]
25032495 return element
@@ -2618,7 +2610,7 @@ def _Layout(self, rows):
26182610 # return self
26192611
26202612 def _GetElementAtLocation (self , location ):
2621- ( row_num , col_num ) = location
2613+ row_num , col_num = location
26222614 row = self .Rows [row_num ]
26232615 element = row [col_num ]
26242616 return element
@@ -2712,7 +2704,7 @@ def _Layout(self, rows):
27122704 self ._AddRow (* row )
27132705
27142706 def _GetElementAtLocation (self , location ):
2715- ( row_num , col_num ) = location
2707+ row_num , col_num = location
27162708 row = self .Rows [row_num ]
27172709 element = row [col_num ]
27182710 return element
@@ -2882,7 +2874,7 @@ def Layout(self, rows):
28822874 self .AddRow (* row )
28832875
28842876 def _GetElementAtLocation (self , location ):
2885- ( row_num , col_num ) = location
2877+ row_num , col_num = location
28862878 row = self .Rows [row_num ]
28872879 element = row [col_num ]
28882880 return element
@@ -3281,7 +3273,7 @@ class Window:
32813273 stdout_string_io = None
32823274 stdout_location = None
32833275 port_number = 6900
3284- active_windows = [] # type: [Window]
3276+ active_windows = [] # type: [Window]
32853277 App = None # type: remi.App
32863278
32873279 def __init__ (
@@ -3645,7 +3637,7 @@ def SetIcon(self, icon=None, pngbase64=None):
36453637 pass
36463638
36473639 def _GetElementAtLocation (self , location ):
3648- ( row_num , col_num ) = location
3640+ row_num , col_num = location
36493641 row = self .Rows [row_num ]
36503642 element = row [col_num ]
36513643 return element
@@ -5310,7 +5302,7 @@ def BuildResultsForSubform(form, initialize_only, top_level_form):
53105302 except :
53115303 value = None
53125304 elif element .Type == ELEM_TYPE_TABLE :
5313- element = element # type:Table
5305+ element = element # type: Table
53145306 value = [
53155307 element .SelectedRow ,
53165308 ]
0 commit comments