Skip to content

Commit

Permalink
python: fix popup function changed when removing pysimplegui
Browse files Browse the repository at this point in the history
We removed the function earlier, and then introduced it back, but with
different arguments.

Signed-off-by: Daniel Schaefer <[email protected]>
  • Loading branch information
JohnAZoidberg committed Nov 25, 2024
1 parent 89186a5 commit a6c0258
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
6 changes: 3 additions & 3 deletions python/inputmodule/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ def main_cli():

if not ports:
print("No device found")
gui.popup(args.gui, "No device found")
gui.popup("No device found", gui=args.gui)
sys.exit(1)
elif args.serial_dev is not None:
filtered_devs = [
Expand All @@ -250,10 +250,10 @@ def main_cli():
dev = ports[0]
elif len(ports) >= 1 and not args.gui:
gui.popup(
args.gui,
"More than 1 compatibles devices found. Please choose from the commandline with --serial-dev COMX.\nConnected ports:\n- {}".format(
"\n- ".join([port.device for port in ports])
),
gui=args.gui,
)
print(
"More than 1 compatible device found. Please choose with --serial-dev ..."
Expand All @@ -268,7 +268,7 @@ def main_cli():

if not args.gui and dev is None:
print("No device selected")
gui.popup(args.gui, "No device selected")
gui.popup("No device selected", gui=args.gui)
sys.exit(1)

if args.bootloader:
Expand Down
5 changes: 3 additions & 2 deletions python/inputmodule/gui/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,9 @@ def update_brightness_slider(devices):
if average_brightness:
brightness_scale.set(average_brightness)

def popup(message):
messagebox.showinfo("Framework Laptop 16 LED Matrix", message)
def popup(message, gui=True):
if gui:
messagebox.showinfo("Framework Laptop 16 LED Matrix", message)

def run_gui(devices):
root = tk.Tk()
Expand Down

0 comments on commit a6c0258

Please sign in to comment.