From dfaf01c692c6252dcbd4edd33ddebb7f74982b57 Mon Sep 17 00:00:00 2001 From: Siddharth Ravikumar Date: Sun, 13 Dec 2015 19:52:41 -0500 Subject: combox defaults to using gui for config. --- ChangeLog | 6 ++++++ combox/cbox.py | 10 +++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 9ddaaf6..c85e938 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2015-12-13 Siddharth Ravikumar + + * combox/cbox.py (main): When it has to configure combox, it uses + the graphical interface by default, if the '-nw' or '--cli' is + provided, it uses the text/commandline interface. + 2015-12-13 Siddharth Ravikumar * combox/gui.py (ComboxConfigDialog.__init__): accepts a new argument called `condig_dir` that allows one to specify the combox diff --git a/combox/cbox.py b/combox/cbox.py index a9b751c..a8891ac 100644 --- a/combox/cbox.py +++ b/combox/cbox.py @@ -31,6 +31,7 @@ from watchdog.observers import Observer from combox.config import config_cb, get_nodedirs from combox.events import ComboxDirMonitor, NodeDirMonitor +from combox.gui import ComboxConfigDialog from combox.log import log_i, log_e ## Function adapted from Watchdog's docs: @@ -92,6 +93,9 @@ def main(): parser.add_argument("-t", "--test", help="Use the combox config file in testing area.", action="store_true") + parser.add_argument("-nw", "--cli", + help="Use CLI interface only", + action="store_true") args = parser.parse_args() if args.test: CONFIG_DIR = path.join('tests', 'test-config') @@ -104,7 +108,11 @@ def main(): if not path.exists(CONFIG_DIR): # combox not configured. - config_cb(CONFIG_DIR) + if not args.cli: + ComboxConfigDialog("combox configuration", CONFIG_DIR) + else: + config_cb(CONFIG_DIR) + try: config = yaml.load(file(config_file, 'r')) except yaml.YAMLError, exc: -- cgit v1.2.3