Skip to content

Commit

Permalink
refactor: dont use try-except for control flow
Browse files Browse the repository at this point in the history
  • Loading branch information
goerlibe committed Mar 9, 2023
1 parent 3fa3dce commit c616144
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions discopop_wizard/wizard.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
# todo add command line option to execute run configuration (by name)
from discopop_wizard.screens.settings import show_settings_screen, save_settings

from discopop_wizard.utils import get_platform, Platform


def main(arguments: Arguments):
print("starting DiscoPoP Wizard...\n")
Expand Down Expand Up @@ -113,10 +115,10 @@ def check():
warnings.warn("Loading the window icon was not successful.")

# set window to full screen
try:
self.window.attributes('-zoomed', True)
except tk.TclError: # above does not work on macOS
if get_platform() in (Platform.OSX, Platform.WINDOWS):
self.window.state("zoomed")
else:
self.window.attributes('-zoomed', True)
self.window.columnconfigure(1, weight=1)
self.window.rowconfigure(1, weight=1)
paned_window = ttk.PanedWindow(self.window, orient=tk.VERTICAL)
Expand Down

0 comments on commit c616144

Please sign in to comment.