Beispiel #1
0
def cli():
    # args = Args()
    # puts(colored.red('Aruments passed in: ') + str(args.all))
    # puts(colored.red('Aruments grouped passed in: ') + str(args.grouped))
    all_args = Args().grouped

    args_len = len(all_args)
    # print(args_len)
    if args_len == 1:
        run()

    elif args_len == 2:
        # print(all_args.keys())
        arg = list(all_args.keys())[1]
        # print(arg)

        if arg in ['-show']:
            show_config()

        elif arg in ['-q']:
            qids = [int(x.strip()) for x in all_args[arg].all]
            # print(qids)
            run_by_id(qids)

        elif arg in ['-h', '-help']:
            show_help()

        elif arg in ['-set']:
            cli_set_config()

        elif arg in ['-readme']:
            readme()

        else:
            puts('You entered wrong command')
            show_help()

    else:
        puts('You entered wrong command')
        show_help()
Beispiel #2
0
    puts(colored.cyan(" " * 17 + "Usage"))
    print "-" * 40
    puts(colored.magenta("Total Time: ") + tds[1].text)
    puts(colored.magenta("Uploaded: ") + tds[2].text)
    puts(colored.magenta("Downloaded: ") + tds[3].text)
    puts(colored.magenta("Total Data: ") + tds[4].text)
    print "-" * 40


if __name__ == '__main__':
    print "-" * 40
    puts(colored.white(" " * 15 + "ProntoUsage"))
    print "-" * 40
    debug = False
    args = Args().grouped
    if '--debug' in args.keys():
        debug = True
    if '--delete' in args.keys():
        try:
            os.remove('cred.json')
        except OSError:
            pass

    if os.path.isfile('cred.json'):
        with open('cred.json', 'r') as f:
            data = json.load(f)
            username = data['username']
            password = data['password']

    else:
        saved = False
Beispiel #3
0
    sd = str(tds[4].text)
    # print(float(filter(str.isdigit, sd)))
    x = map(float, re.findall(r'[+-]?[0-9.]+', sd))

    textmyself.textmyself("Hey! Rahul you have used " + sd)

    print "-" * 40


if __name__ == '__main__':
    print "-" * 40
    puts(colored.white(" " * 15 + "ProntoUsage"))
    print "-" * 40
    debug = False
    args = Args().grouped
    if '--debug' in args.keys():
        debug = True
    if '--delete' in args.keys():
        try:
            os.remove('cred.json')
        except OSError:
            pass

    if os.path.isfile('cred.json'):
        with open('cred.json', 'r') as f:
            data = json.load(f)
            username = data['username']
            password = data['password']

    else:
        saved = False