Skip to content

Commit d308577

Browse files
committed
python: fix popup function changed when removing pysimplegui
We removed the function earlier, and then introduced it back, but with different arguments. Signed-off-by: Daniel Schaefer <[email protected]>
1 parent 5e039fe commit d308577

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

python/inputmodule/cli.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ def main_cli():
237237

238238
if not ports:
239239
print("No device found")
240-
gui.popup(args.gui, "No device found")
240+
gui.popup("No device found", gui=args.gui)
241241
sys.exit(1)
242242
elif args.serial_dev is not None:
243243
filtered_devs = [
@@ -250,10 +250,10 @@ def main_cli():
250250
dev = ports[0]
251251
elif len(ports) >= 1 and not args.gui:
252252
gui.popup(
253-
args.gui,
254253
"More than 1 compatibles devices found. Please choose from the commandline with --serial-dev COMX.\nConnected ports:\n- {}".format(
255254
"\n- ".join([port.device for port in ports])
256255
),
256+
gui=args.gui,
257257
)
258258
print(
259259
"More than 1 compatible device found. Please choose with --serial-dev ..."
@@ -268,7 +268,7 @@ def main_cli():
268268

269269
if not args.gui and dev is None:
270270
print("No device selected")
271-
gui.popup(args.gui, "No device selected")
271+
gui.popup("No device selected", gui=args.gui)
272272
sys.exit(1)
273273

274274
if args.bootloader:

python/inputmodule/gui/__init__.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,9 @@ def update_brightness_slider(devices):
4444
if average_brightness:
4545
brightness_scale.set(average_brightness)
4646

47-
def popup(message):
48-
messagebox.showinfo("Framework Laptop 16 LED Matrix", message)
47+
def popup(message, gui=True):
48+
if gui:
49+
messagebox.showinfo("Framework Laptop 16 LED Matrix", message)
4950

5051
def run_gui(devices):
5152
root = tk.Tk()

0 commit comments

Comments
 (0)