def delete_task(args): args = parse_login_command_line(args, [], ['i', 'all'], help=lixian_help.delete) client = XunleiClient(args.username, args.password, args.cookies) to_delete = search_tasks(client, args) print "Below files are going to be deleted:" for x in to_delete: print x['name'].encode(default_encoding) if args.i: yes_or_no = raw_input('Are your sure to delete below files from Xunlei cloud? ') while yes_or_no.lower() not in ('y', 'yes', 'n', 'no'): yes_or_no = raw_input('yes or no? ') if yes_or_no.lower() in ('y', 'yes'): pass elif yes_or_no.lower() in ('n', 'no'): raise RuntimeError('Deletion abort per user request.') client.delete_tasks(to_delete)
def delete_task(args): args = parse_login_command_line(args, [], ["i", "all"], help=lixian_help.delete) client = XunleiClient(args.username, args.password, args.cookies) to_delete = search_tasks(client, args) print "Below files are going to be deleted:" for x in to_delete: print x["name"].encode(default_encoding) if args.i: yes_or_no = raw_input("Are your sure to delete below files from Xunlei cloud? ") while yes_or_no.lower() not in ("y", "yes", "n", "no"): yes_or_no = raw_input("yes or no? ") if yes_or_no.lower() in ("y", "yes"): pass elif yes_or_no.lower() in ("n", "no"): raise RuntimeError("Deletion abort per user request.") client.delete_tasks(to_delete)
def delete_task(args): client = XunleiClient(args.username, args.password, args.cookies) to_delete = search_tasks(client, args) from lixian_colors import colors with colors.red.bold(): print "Below files are going to be deleted:" for x in to_delete: print x["name"].encode(default_encoding) if args.i: yes_or_no = raw_input("Are your sure to delete below files from Xunlei cloud? ") while yes_or_no.lower() not in ("y", "yes", "n", "no"): yes_or_no = raw_input("yes or no? ") if yes_or_no.lower() in ("y", "yes"): pass elif yes_or_no.lower() in ("n", "no"): raise RuntimeError("Deletion abort per user request.") client.delete_tasks(to_delete)
def delete_task(args): client = XunleiClient(args.username, args.password, args.cookies) to_delete = lixian_query.search_tasks(client, args) if not to_delete: print 'Nothing to delete' return with colors(args.colors).red.bold(): print "Below files are going to be deleted:" for x in to_delete: print x['name'].encode(default_encoding) if args.i: yes_or_no = raw_input('Are your sure to delete below files from Xunlei cloud? ') while yes_or_no.lower() not in ('y', 'yes', 'n', 'no'): yes_or_no = raw_input('yes or no? ') if yes_or_no.lower() in ('y', 'yes'): pass elif yes_or_no.lower() in ('n', 'no'): raise RuntimeError('Deletion abort per user request.') client.delete_tasks(to_delete)
def delete_task(args): client = XunleiClient(args.username, args.password, args.cookies) to_delete = lixian_query.search_tasks(client, args) if not to_delete: print 'Nothing to delete' return with colors(args.colors).red.bold(): print "Below files are going to be deleted:" for x in to_delete: print x['name'].encode(default_encoding) if args.i: yes_or_no = raw_input( 'Are your sure to delete below files from Xunlei cloud? ') while yes_or_no.lower() not in ('y', 'yes', 'n', 'no'): yes_or_no = raw_input('yes or no? ') if yes_or_no.lower() in ('y', 'yes'): pass elif yes_or_no.lower() in ('n', 'no'): raise RuntimeError('Deletion abort per user request.') client.delete_tasks(to_delete)