Skip to content

Commit ae96791

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent df3b46e commit ae96791

9 files changed

Lines changed: 42 additions & 60 deletions

File tree

FreeSimpleGUI/__init__.py

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
from typing import List # noqa
3737
from typing import Tuple # noqa
3838

39-
4039
# get the tkinter detailed version
4140
tclversion_detailed = tkinter.Tcl().eval('info patchlevel')
4241
framework_version = tclversion_detailed
@@ -14538,9 +14537,7 @@ def _github_issue_post_make_markdown(
1453814537
#### Project details
1453914538

1454014539
{}
14541-
""".format(
14542-
issue_type, operating_system, os_ver, psg_port, python_ver, psg_ver, gui_ver, project_details
14543-
)
14540+
""".format(issue_type, operating_system, os_ver, psg_port, python_ver, psg_ver, gui_ver, project_details)
1454414541

1454514542
body2 = """
1454614543

@@ -14610,17 +14607,13 @@ def _github_issue_post_make_markdown(
1461014607
body2 += """
1461114608
## Watcha Makin?
1461214609
{}
14613-
""".format(
14614-
str(project_details)
14615-
)
14610+
""".format(str(project_details))
1461614611

1461714612
if where_found:
1461814613
body2 += """
1461914614
## How did you find PySimpleGUI?
1462014615
{}
14621-
""".format(
14622-
str(where_found)
14623-
)
14616+
""".format(str(where_found))
1462414617
return body + body2
1462514618

1462614619

FreeSimpleGUI/elements/column.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ def _GetElementAtLocation(self, location):
388388
:rtype: (Element)
389389
"""
390390

391-
(row_num, col_num) = location
391+
row_num, col_num = location
392392
row = self.Rows[row_num]
393393
element = row[col_num]
394394
return element

FreeSimpleGUI/elements/frame.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ def _GetElementAtLocation(self, location):
230230
:rtype: (Element)
231231
"""
232232

233-
(row_num, col_num) = location
233+
row_num, col_num = location
234234
row = self.Rows[row_num]
235235
element = row[col_num]
236236
return element

FreeSimpleGUI/elements/tab.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ def _GetElementAtLocation(self, location):
282282
:rtype: (Element)
283283
"""
284284

285-
(row_num, col_num) = location
285+
row_num, col_num = location
286286
row = self.Rows[row_num]
287287
element = row[col_num]
288288
return element
@@ -540,7 +540,7 @@ def _GetElementAtLocation(self, location):
540540
:rtype: (Element)
541541
"""
542542

543-
(row_num, col_num) = location
543+
row_num, col_num = location
544544
row = self.Rows[row_num]
545545
element = row[col_num]
546546
return element

FreeSimpleGUI/tray.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
from FreeSimpleGUI.elements.image import Image
2020
from FreeSimpleGUI.window import Window
2121

22-
2322
_tray_icon_error = b'iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAAA3NCSVQICAjb4U/gAAAACXBIWXMAAADlAAAA5QGP5Zs8AAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAAAIpQTFRF////20lt30Bg30pg4FJc409g4FBe4E9f4U9f4U9g4U9f4E9g31Bf4E9f4E9f4E9f4E9f4E9f4FFh4Vdm4lhn42Bv5GNx5W575nJ/6HqH6HyI6YCM6YGM6YGN6oaR8Kev9MPI9cbM9snO9s3R+Nfb+dzg+d/i++vt/O7v/fb3/vj5//z8//7+////KofnuQAAABF0Uk5TAAcIGBktSYSXmMHI2uPy8/XVqDFbAAAA8UlEQVQ4y4VT15LCMBBTQkgPYem9d9D//x4P2I7vILN68kj2WtsAhyDO8rKuyzyLA3wjSnvi0Eujf3KY9OUP+kno651CvlB0Gr1byQ9UXff+py5SmRhhIS0oPj4SaUUCAJHxP9+tLb/ezU0uEYDUsCc+l5/T8smTIVMgsPXZkvepiMj0Tm5txQLENu7gSF7HIuMreRxYNkbmHI0u5Hk4PJOXkSMz5I3nyY08HMjbpOFylF5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PcDBfUDBvYEAPYEAfYEAvYEA/QGAPQGAfQGAvYEBPUEBvYFB/QGBPQGBfQHB/EFCvIHCPMHCfIHC/IFDfMHDPQGCPQGCfQGCvEIBPIIBfAIB/UIB/QICPYICfoBAPoBAfoBAvsBA/kCAPkCAfkCAvkCA/oBBPkCBPkCBfkCBvgCB/gEAPkEAfgEAvkEA/gGAfkGAvkEBPgEBfkEBv0AAP0AAfwAAvwAA/wCAPwCAfwCAvwCA/wABP0ABfwCBfwEAPwFA/ASD/ESFPAUEvAUE/EXFvAdH+kbIOobIeofIfEfIOcmKOohIukgJOggJesiKuwiKewoLe0tLO0oMOQ3OO43Oew4OfAhIPAhIfAiIPEiI+dDRe9ES+lQTOdSWupSUOhTUehSV+hUVu1QUO1RUe1SV+tTWe5SWOxXWOpYV+pZWelYXexaW+xaXO9aX+lZYeNhYOxjZ+lna+psbOttbehsbupscepucuxtcuxucep3fet7e+p/ffB6gOmKiu2Iie2Sk+2Qle2QluySlOyTleuYmvKFivCOjgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIxGNZsAAAEAdFJOU////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////wBT9wclAAAACXBIWXMAAA7DAAAOwwHHb6hkAAACVElEQVQ4T22S93PTMBhADQdl791SSsuRARTKKHsn+STZBptAi6zIacous+w9yyxl7z1T1h8ptHLhrrzLD5+/987R2XZElZ/39tZsbGg42NdvF4pqcGMs4XEcozAB/oQeu6wGr5fkAZcKOUIIRgQXR723wgaXt/NSgcwlO1r3oARkATfhbmNMMCnlMZdz5J8RN9fVhglS5JA/pJUOJiYXoShCkz/flheDvpzlBCBmya5KcDG1sMSB+r/VQtG+YoFXlwN0Us4yeBXujPmWCOqNlVwX5zHntLH5iQ420YiqX9pqTZFSCrBGBc+InBUDAsbwLRlMC40fGJT8YLRwfnhY3v6/AUtDc9m5z0tRJBOAvHUaFchdY6+zDzEghHv1tUnrNCaIOw84Q2WQmkeO/Xopj1xFBREFr8ZZjuRhA++PEB+t05ggwBucpbH8i/n5C1ZU0EEEmRZnSMxoIYcarKigA0Cb1zpHAyZnGj21xqICAA9dcvo4UgEdZ41FBZSTzEOn30f6QeE3Vhl0gLN+2RGDzZPMHLHKoAO3MFy+ix4sDxFlvMXfrdNgFezy7qrXPaaJg0u27j5nneKrCjJ4pf4e3m4DVMcjNNNKxWnpo6jtnfnkunExB4GbuGKk5FNanpB1nJCjCsThJPAAJ8lVdSF5sSrklM2ZqmYdiC40G7Dfnhp57ZsQz6c3hylEO6ZoZQJxqiVgbhoQK3T6AIgU4rbjxthAPF6NAwAOAcS+ixlp/WBFJRDi0fj2RtcjWRwif8Qdu/w3EKLcu3/YslnrZzwo24UQQvwFCrp/iM1NnHwAAAAASUVORK5CYII='

FreeSimpleGUI/window.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -821,7 +821,7 @@ def _GetElementAtLocation(self, location):
821821
:rtype:
822822
"""
823823

824-
(row_num, col_num) = location
824+
row_num, col_num = location
825825
row = self.Rows[row_num]
826826
element = row[col_num]
827827
return element
@@ -2760,7 +2760,7 @@ def timer_get_active_timers(self):
27602760
@classmethod
27612761
def _restore_stdout(cls):
27622762
for item in cls._rerouted_stdout_stack:
2763-
(window, element) = item # type: (Window, Element)
2763+
window, element = item # type: (Window, Element)
27642764
if not window.is_closed():
27652765
sys.stdout = element
27662766
break
@@ -2772,7 +2772,7 @@ def _restore_stdout(cls):
27722772
@classmethod
27732773
def _restore_stderr(cls):
27742774
for item in cls._rerouted_stderr_stack:
2775-
(window, element) = item # type: (Window, Element)
2775+
window, element = item # type: (Window, Element)
27762776
if not window.is_closed():
27772777
sys.stderr = element
27782778
break

FreeSimpleGUIQt/FreeSimpleGUIQt/__init__.py

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3320,7 +3320,7 @@ def Layout(self, rows):
33203320
self.AddRow(*row)
33213321

33223322
def _GetElementAtLocation(self, location):
3323-
(row_num, col_num) = location
3323+
row_num, col_num = location
33243324
row = self.Rows[row_num]
33253325
element = row[col_num]
33263326
return element
@@ -3485,7 +3485,7 @@ def Update(self, disabled=None, visible=None): # TODO Disable / enable of tabs
34853485
return self
34863486

34873487
def _GetElementAtLocation(self, location):
3488-
(row_num, col_num) = location
3488+
row_num, col_num = location
34893489
row = self.Rows[row_num]
34903490
element = row[col_num]
34913491
return element
@@ -3619,7 +3619,7 @@ def Layout(self, rows):
36193619
self.AddRow(*row)
36203620

36213621
def _GetElementAtLocation(self, location):
3622-
(row_num, col_num) = location
3622+
row_num, col_num = location
36233623
row = self.Rows[row_num]
36243624
element = row[col_num]
36253625
return element
@@ -3749,7 +3749,7 @@ def __init__(
37493749
temp_size = (150, 30) if self.Orientation.startswith('h') else (30, 150)
37503750
elif size[0] is not None and size[0] < 100:
37513751
temp_size = size[0] * 10, size[1] * 3
3752-
self.Widget = self.QT_Slider = None # type:QSlider
3752+
self.Widget = self.QT_Slider = None # type: QSlider
37533753

37543754
super().__init__(
37553755
ELEM_TYPE_INPUT_SLIDER,
@@ -4039,7 +4039,7 @@ def Layout(self, rows):
40394039
self.AddRow(*row)
40404040

40414041
def _GetElementAtLocation(self, location):
4042-
(row_num, col_num) = location
4042+
row_num, col_num = location
40434043
row = self.Rows[row_num]
40444044
element = row[col_num]
40454045
return element
@@ -5196,7 +5196,7 @@ def SetIcon(self, icon=None, pngbase64=None):
51965196
pass
51975197

51985198
def _GetElementAtLocation(self, location):
5199-
(row_num, col_num) = location
5199+
row_num, col_num = location
52005200
row = self.Rows[row_num]
52015201
element = row[col_num]
52025202
return element
@@ -6015,14 +6015,12 @@ def create_style_from_font(font):
60156015
is_bold_text = 'font-weight : bold;' if is_bold else ''
60166016
is_underline_text = 'text-decoration: underline;' if is_underline else ''
60176017

6018-
return textwrap.dedent(
6019-
f'''
6018+
return textwrap.dedent(f'''
60206019
{is_underline_text}
60216020
{is_bold_text}
60226021
font-family: "{font_name}";
60236022
font-size: {font_size}pt;
6024-
'''.strip()
6025-
).replace('\n', '')
6023+
'''.strip()).replace('\n', '')
60266024

60276025

60286026
def set_widget_visiblity(widget, visible):
@@ -8757,7 +8755,7 @@ def PackFormIntoFrame(container_elem, containing_frame, toplevel_win):
87578755
container_elem.QT_QTabWidget.addTab(tab_widget, element.Title)
87588756
# ------------------------- TabGroup placement element ------------------------- #
87598757
elif element_type == ELEM_TYPE_TAB_GROUP:
8760-
element = element # type:TabGroup
8758+
element = element # type: TabGroup
87618759
element.Widget = element.QT_QTabWidget = qtab = QTabWidget()
87628760

87638761
# === style ===

FreeSimpleGUIWeb/FreeSimpleGUIWeb/__init__.py

Lines changed: 13 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
import time
2323
import 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

Comments
 (0)