From 153665883ff788d0bffeb330b2df02349688c1fe Mon Sep 17 00:00:00 2001 From: "Fredrick W. Warren" Date: Wed, 26 Feb 2025 13:12:24 -0700 Subject: [PATCH] added click cli options --- pywmreceived.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/pywmreceived.py b/pywmreceived.py index 3103740..174679f 100755 --- a/pywmreceived.py +++ b/pywmreceived.py @@ -6,17 +6,19 @@ Copyright (C) 2025 Fredrick W. Warren Licensed under the GNU General Public License. """ -import logging -from wmdocklib import wmoo as wmoo +import click import dbus import dbus.mainloop.glib -from gi.repository import GLib -import threading +import logging import os +import threading +from gi.repository import GLib from icecream import ic +from wmdocklib import wmoo as wmoo from xpm_resources import palette, background, patterns line_height = 9 +config_file = os.path.expanduser("~/.config") + '/pywmreceived/config.ini' logging.basicConfig(level=logging.INFO) logger = logging.getLogger(__name__) @@ -237,13 +239,16 @@ def run_glib_mainloop(): except KeyboardInterrupt: loop.quit() -def main(): +@click.command() +@click.option('--config', '-c', default=config_file, help='Path to the configuration file.') +@click.option('--debug/-d', envvar='DEVELOPMENT', default='false', help='Enable debug output') +def main(config, debug): """ The main entry point of the application. Parameters: """ - if os.environ.get("PRODUCTION") == "true": + if not debug: ic.disable() app = Application(font_name='5x8',