def main(): args = ARGS.parse_args() user = args.config if os.path.exists(args.config) else None cfg = cfg_apply(CFG, args=args, user=user) logging.basicConfig() logging.getLogger().setLevel(logging.INFO) if cfg["debug"]: logging.getLogger().setLevel(logging.DEBUG) if args.info: do_info(cfg) sys.exit(0) do_www(cfg) sys.exit(0)
def main(): # init configuration CFG["includes"] = ["*.txts"] CFG["roots"] = ["/home/hevi/wrk"] # handle command line args args = ARGS.parse_args() user_config = args.config if os.path.exists(args.config) else None cfg = cfg_apply(CFG, args=args, user=user_config) # setup logging logging.basicConfig() logging.getLogger().setLevel(logging.INFO) if cfg["debug"]: logging.getLogger().setLevel(logging.DEBUG) # execute if args.info: do_info(cfg) elif args.store: do_store(cfg) else: do_www(cfg)