Breaking up the code smell regarding the CFG.py!
It began smelling already but having some duplicate code across the interfaces is still better than having all of it all over the place. It enables to write specific flags which are nice to have. For example, Import.py requires the --Import flag because it WANTS the user to read the whole Help before it acts actually as an importer. When the user supplies something they should know what's currently happening. Also removes the hardcoded dependency on lib.CFG-Calls from most calls which was already embarassingly present. Introduced some db and cfg-variables which doesnt clutter anything but suck much less. In future we provide a set of default arguments and a bare minimum - config_ui as the bare minimum, default as the full blown storm. This is rather big because it also patches several other smells including a bug where a user from the db wouldnt be reported as existentpull/4/head
parent
934b6bf75a
commit
710ceacd7c
@ -0,0 +1,7 @@
|
||||
import lib.uis.default
|
||||
|
||||
argparser = lib.uis.default.argparser
|
||||
|
||||
args = argparser.parse_args()
|
||||
config = argparser.ConfigParser()
|
||||
config.read(args.config)
|
@ -1,6 +1,6 @@
|
||||
import argparse
|
||||
import lib.cwd
|
||||
|
||||
argparser = argparse.ArgumentParser(description='Tilde administration tools')
|
||||
argparser = argparse.ArgumentParser(description='Tilde administration tools ', conflict_handler="resolve")
|
||||
argparser.add_argument('-c', '--config', default=lib.cwd.cwd,
|
||||
type=str, help='Path to configuration file', required=False)
|
||||
|
Loading…
Reference in New Issue