def cli(): """ Adapting cli... Usage: habitica [--version] [--help] <command> [<args>...] [--difficulty=<d>] [--verbose | --debug] Options: -h --help Show this screen --version Show version --difficulty=<d> (easy | medium | hard) [default: easy] --verbose Show some logging information --debug Some all logging information The habitica commands are: status Show HP, XP, GP, and more habits List habit tasks habits up <task-id> Up (+) habit <task-id> habits down <task-id> Down (-) habit <task-id> dailies List daily tasks dailies done Mark daily <task-id> complete dailies undo Mark daily <task-id> incomplete todos List todo tasks todos done <task-id> Mark one or more todo <task-id> completed todos add <task> Add todo with description <task> server Show status of Habitica service home Open tasks page in default browser For `habits up|down`, `dailies done|undo`, and `todos done`, you can pass one or more <task-id> parameters, using either comma-separated lists or ranges or both. For example, `todos done 1,3,6-9,11`. """ # set up args args = docopt(cli.__doc__, version=VERSION) # set up logging def verbose(): logging.basicConfig(level=logging.INFO) return def debug(): logging.basicConfig(level=logging.DEBUG) return logging.debug('Command line args: {%s}' % ', '.join("'%s': '%s'" % (k, v) for k, v in list(args.items()))) # Set up auth auth = load_auth(AUTH_CONF) # Prepare cache cache = load_cache(CACHE_CONF) # instantiate api service hbt = api.Habitica(auth=auth) return
def get_started(config): """ Intended to get everything up and running for a first pass. This should run first. """ from main import load_auth from habitica import api auth = load_auth(config) hbt = api.Habitica(auth=auth) return auth, hbt
def cli(): """ Adapting cli... Usage: habitica [--version] [--help] <command> [<args>...] [--difficulty=<d>] [--verbose | --debug] Options: -h --help Show this screen --version Show version --difficulty=<d> (easy | medium | hard) [default: easy] --verbose Show some logging information --debug Some all logging information The habitica commands are: status Show HP, XP, GP, and more habits List habit tasks habits up <task-id> Up (+) habit <task-id> habits down <task-id> Down (-) habit <task-id> dailies List daily tasks dailies done Mark daily <task-id> complete dailies undo Mark daily <task-id> incomplete todos List todo tasks todos done <task-id> Mark one or more todo <task-id> completed todos add <task> Add todo with description <task> server Show status of Habitica service home Open tasks page in default browser For `habits up|down`, `dailies done|undo`, and `todos done`, you can pass one or more <task-id> parameters, using either comma-separated lists or ranges or both. For example, `todos done 1,3,6-9,11`. """ # set up args args = docopt(cli.__doc__, version=VERSION) # set up logging def verbose(): logging.basicConfig(level=logging.INFO) return def debug(): logging.basicConfig(level=logging.DEBUG) return logging.debug('Command line args: {%s}' % ', '.join("'%s': '%s'" % (k, v) for k, v in args.items())) # Set up auth auth = load_auth(AUTH_CONF) # Prepare cache cache = load_cache(CACHE_CONF) # instantiate api service hbt = api.Habitica(auth=auth) return