Skip to content

Commit 8417d44

Browse files
committed
apply pre-commit changes
1 parent b8cd8cb commit 8417d44

File tree

387 files changed

+10256
-10339
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

387 files changed

+10256
-10339
lines changed

.pre-commit-config.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v4.5.0
4+
hooks:
5+
- id: mixed-line-ending
6+
args: ["-f", "lf"]
7+
- id: check-yaml
8+
- id: check-toml
9+
- id: end-of-file-fixer
10+
- id: trailing-whitespace
11+
- id: double-quote-string-fixer
12+
files: ^(FreeSimpleGUI.*)/.*\.py

DemoPrograms/Browser_START_HERE_Demo_Programs_Browser.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,31 +12,31 @@
1212
1313
Originaly written for PySimpleGUI Demo Programs, but expanded to
1414
be a general purpose tool. Enable Advanced Mode in settings for more fun
15-
15+
1616
Use to filter and search your source code tree.
1717
Then run or edit your files
1818
1919
Filter the list of :
2020
* Search using filename
2121
* Searching within the programs' source code (like grep)
22-
22+
2323
The basic file operations are
2424
* Edit a file in your editor
2525
* Run a file
2626
* Filter file list
2727
* Search in files
2828
* Run a regular expression search on all files
2929
* Display the matching line in a file
30-
30+
3131
Additional operations
3232
* Edit this file in editor
33-
33+
3434
Keeps a "history" of the previously chosen folders to easy switching between projects
35-
35+
3636
Versions:
3737
1.8.0 - Addition of option to show ALL file types, not just Python files
38-
1.12.0 - Fix for problem with spaces in filename and using an editor specified in the demo program settings
39-
1.12.2 - Better error handling for no editor configured
38+
1.12.0 - Fix for problem with spaces in filename and using an editor specified in the demo program settings
39+
1.12.2 - Better error handling for no editor configured
4040
Copyright 2021, 2022 PySimpleGUI.org
4141
"""
4242

@@ -187,7 +187,7 @@ def get_line_number(file_path, string, dupe_lines):
187187
if string.strip() == line.strip() and num not in dupe_lines:
188188
lmn = num
189189
return lmn
190-
190+
191191
def kill_ascii(s):
192192
return "".join([x if ord(x) < 128 else '?' for x in s])
193193

@@ -327,7 +327,7 @@ def find_in_file(string, demo_files_dict, regex=False, verbose=False, window=Non
327327
list_of_matches.append(_match.strip())
328328
file_array_old.append(file_array_new)
329329
file_array_old.append(file_match_list)
330-
330+
331331
if tail in file_lines_dict:
332332
for i in range(1, 100):
333333
new_tail = f'{tail}_{i}'
@@ -557,7 +557,7 @@ def main():
557557
while True:
558558
event, values = window.read()
559559
# print(event, values)
560-
560+
561561
counter += 1
562562
if event in (sg.WINDOW_CLOSED, 'Exit'):
563563
break

DemoPrograms/Demo_All_Elements.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def make_window(theme):
3030
input_layout = [
3131

3232
# [sg.Menu(menu_def, key='-MENU-')],
33-
[sg.Text('Anything that requires user-input is in this tab!')],
33+
[sg.Text('Anything that requires user-input is in this tab!')],
3434
[sg.Input(key='-INPUT-')],
3535
[sg.Slider(orientation='h', key='-SKIDER-'),
3636
sg.Image(data=sg.DEFAULT_BASE64_LOADING_GIF, enable_events=True, key='-GIF-IMAGE-'),],
@@ -51,7 +51,7 @@ def make_window(theme):
5151
reroute_stdout=True, reroute_stderr=True, echo_stdout_stderr=True, autoscroll=True, auto_refresh=True)]
5252
# [sg.Output(size=(60,15), font='Courier 8', expand_x=True, expand_y=True)]
5353
]
54-
54+
5555
graphing_layout = [[sg.Text("Anything you would use to graph will display here!")],
5656
[sg.Graph((200,200), (0,0),(200,200),background_color="black", key='-GRAPH-', enable_events=True,
5757
right_click_menu=graph_right_click_menu_def)],
@@ -69,14 +69,14 @@ def make_window(theme):
6969
popup_layout = [[sg.Text("Popup Testing")],
7070
[sg.Button("Open Folder")],
7171
[sg.Button("Open File")]]
72-
72+
7373
theme_layout = [[sg.Text("See how elements look under different themes by choosing a different theme here!")],
74-
[sg.Listbox(values = sg.theme_list(),
75-
size =(20, 12),
74+
[sg.Listbox(values = sg.theme_list(),
75+
size =(20, 12),
7676
key ='-THEME LISTBOX-',
7777
enable_events = True)],
7878
[sg.Button("Set Theme")]]
79-
79+
8080
layout = [ [sg.MenubarCustom(menu_def, key='-MENU-', font='Courier 15', tearoff=True)],
8181
[sg.Text('Demo Of (Almost) All Elements', size=(38, 1), justification='center', font=("Helvetica", 16), relief=sg.RELIEF_RIDGE, k='-TEXT HEADING-', enable_events=True)]]
8282
layout +=[[sg.TabGroup([[ sg.Tab('Input Elements', input_layout),
@@ -95,7 +95,7 @@ def make_window(theme):
9595
def main():
9696
window = make_window(sg.theme())
9797

98-
# This is an Event Loop
98+
# This is an Event Loop
9999
while True:
100100
event, values = window.read(timeout=100)
101101
# keep an animation running so show things are happening
@@ -160,4 +160,4 @@ def main():
160160
sg.theme('dark red')
161161
sg.theme('dark green 7')
162162
# sg.theme('DefaultNoMoreNagging')
163-
main()
163+
main()

DemoPrograms/Demo_All_Elements_Simple.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,5 +103,3 @@ def name(name):
103103
elif event == 'Version':
104104
sg.popup_scrolled(__file__, sg.get_versions(), keep_on_top=True, non_blocking=True)
105105
window.close()
106-
107-

DemoPrograms/Demo_Animated_GIFs.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22

33
"""
44
Demo_Animated_GIFs.py
5-
5+
66
Shows how to:
77
* Use popup_animated
88
* Use animated GIF in a custom window layout
99
* Store your GIFs in base64 format inside this source file (copy and paste into your source file)
10-
10+
1111
The first image that uses popup_animated will stop after a few seconds on its own.
1212
The remaining images are shown 1 at a time. To move on to the next image, click the current image.
1313
If you want to exit before reaching the final image, right click the image and choose 'exit'
14-
14+
1515
Copyright 2022 PySimpleGUI
1616
"""
1717

@@ -62,4 +62,4 @@
6262
offset += (offset < len(gifs)-1) # add 1 until the last one
6363
gif = gifs[offset] # get a new gif image
6464
# update the animation in the window
65-
window['-IMAGE-'].update_animation(gif, time_between_frames=100)
65+
window['-IMAGE-'].update_animation(gif, time_between_frames=100)

DemoPrograms/Demo_Animated_GIFs_Using_PIL.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33

44
"""
55
Demo_Animated_GIFs_Using_PIL.py
6-
6+
77
You'll find other animated GIF playback demos for PySimpleGUI that use the tkinter built-in GIF parser.
88
That is how the built-in PySimpleGUI Image.update_animation is used.
9-
9+
1010
If you want to do the GIF file parsing yourself using PIL and update your Image element yourself, then
1111
this is one possible technique.
1212
@@ -30,4 +30,4 @@
3030
event, values = window.read(timeout=interframe_duration)
3131
if event == sg.WIN_CLOSED:
3232
exit(0)
33-
window['-IMAGE-'].update(data=ImageTk.PhotoImage(frame) )
33+
window['-IMAGE-'].update(data=ImageTk.PhotoImage(frame) )

DemoPrograms/Demo_Bar_Chart.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
The Graph Element is very versatile. Because you can define your own
88
coordinate system, it makes producing graphs of many lines (bar, line, etc) very
99
straightforward.
10-
10+
1111
In this Demo a "bar" is nothing more than a rectangle drawn in a Graph Element (draw_rectangle).
12-
12+
1313
To make things a little more interesting, this is a barchart with that data values
1414
placed as labels atop each bar, another Graph element method (draw_text)
1515
@@ -52,4 +52,4 @@
5252
break
5353

5454

55-
window.close()
55+
window.close()

DemoPrograms/Demo_Base64_Image_Encoder.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,4 @@ def main():
3636
sg.popup('Completed!', 'Encoded %s files'%(i+1))
3737

3838
if __name__ == '__main__':
39-
main()
39+
main()

DemoPrograms/Demo_Base64_Single_Image_Encoder.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
1919
Input: a single image file
2020
Output: clipboard will contain the Base64 Byte String of the source image
21-
21+
2222
Copyright 2021 PySimpleGUI
2323
"""
2424

DemoPrograms/Demo_Button_Simulated_With_Highlighting_Using_Bind.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,4 +76,4 @@ def main():
7676

7777

7878
if __name__ == '__main__':
79-
main()
79+
main()

0 commit comments

Comments
 (0)