diff options
| author | Chandler J <cjustice2000@gmail.com> | 2024-04-12 20:44:47 -0600 |
|---|---|---|
| committer | Chandler J <cjustice2000@gmail.com> | 2024-04-12 20:44:47 -0600 |
| commit | 95e73b141ca8f3618701ff59658ef519353cc7c0 (patch) | |
| tree | 27967d34376bc6ed624c12c758f580a712765118 /src/get_args.py | |
| parent | b7dc1316ab0eb51f408b2b7782571d868ad3b864 (diff) | |
major changes:
- Can now save/load themes which entails the color scheme and
wallpaper
- Can now use themes to load colors independent of background image
- refactoring to make code less bad
Diffstat (limited to 'src/get_args.py')
| -rw-r--r-- | src/get_args.py | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/get_args.py b/src/get_args.py index ebdf464..da6476e 100644 --- a/src/get_args.py +++ b/src/get_args.py @@ -7,15 +7,16 @@ def get_args(args, walls_dir) -> tuple: # arguments that can be passed into program initialize = False reconfigure = False - color_save = None + theme = None VALID_ARGS = ['-r', '-p', '--initialize', '--reconfigure'] + if '-p' in args: index = args.index('-p') - if os.path.isfile(args[index + 1]): - color_save = manage_saves.load_color_palette(args[index + 1]) - else: - print('invalid arguments. -p should be followed by a color palette save') - exit(2) + isFile = os.path.isfile(args[index + 1]) + if isFile == True: + print("reached") + theme = manage_saves.load_theme(args[index + 1]) + if '-r' in args: img_path = user_interface.pickRandomWallpaper(walls_dir) @@ -24,13 +25,13 @@ def get_args(args, walls_dir) -> tuple: if not os.path.exists(img_path) and\ args[1] not in VALID_ARGS: print(f'[bold red]ERROR: invalid image path {os.getcwd()}/{args[1]}') - exit(3) + exit(2) if '--initialize' in args: initialize = True if '--reconfigure' in args: reconfigure = True - return img_path, initialize, reconfigure, color_save + return img_path, initialize, reconfigure, theme def usage(args) -> None: print(f"""Instant Rice - An automatic theming utilitiy |
