taskwarrior-grocy/cli.py

37 lines
551 B
Python

import click
from os import path
APP_NAME = 'twservices'
def __create_config_file():
@click.command()
@click.group()
def main():
pass
def get_config_file()
no_config_msg = 'A config file was not found ' +
'and will be created under {0}. Is that Ok?'.format(click.get_app_dir(APP_NAME))
cfg_file = path.join(click.get_app_dir(APP_NAME), 'config.yml')
if not path.exists(cfg_file):
create_config_app_dir = click.confirm(no_config_msg)
if create_config_app_dir:
@main.command()
def sync():