def run_add_prompt(parsed_args, printer): if parsed_args.title is None: parsed_args.title = get_input(printer, 'Title: ', STR_NOT_EMPTY) if parsed_args.category is None: parsed_args.category = get_input(printer, 'Category: ', VALID_CATEGORY) parsed_args.title = parsed_args.title + parsed_args.category if parsed_args.where is None: parsed_args.where = get_input(printer, 'Location: ', STR_ALLOW_EMPTY) if parsed_args.when is None: parsed_args.when = get_input(printer, 'When: ', PARSABLE_DATE) if parsed_args.duration is None: if parsed_args.allday: prompt = 'Duration (days): ' else: prompt = 'Duration (human readable): ' parsed_args.duration = get_input(printer, prompt, PARSABLE_DURATION) if parsed_args.description is None: parsed_args.description = get_input(printer, 'Description: ', STR_ALLOW_EMPTY) if not parsed_args.reminders: while True: r = get_input(printer, 'Enter a valid reminder or ' '"." to end: ', REMINDER) if r == '.': break n, m = utils.parse_reminder(str(r)) parsed_args.reminders.append(str(n) + ' ' + m)
def run_add_prompt(parsed_args, printer): if parsed_args.title is None: parsed_args.title = get_input(printer, 'Title: ', STR_NOT_EMPTY) if parsed_args.where is None: parsed_args.where = get_input(printer, 'Location: ', STR_ALLOW_EMPTY) if parsed_args.when is None: parsed_args.when = get_input(printer, 'When: ', PARSABLE_DATE) if parsed_args.duration is None: if parsed_args.allday: prompt = 'Duration (days): ' else: prompt = 'Duration (minutes): ' parsed_args.duration = get_input(printer, prompt, STR_TO_INT) if parsed_args.description is None: parsed_args.description = get_input(printer, 'Description: ', STR_ALLOW_EMPTY) if not parsed_args.reminders: while True: r = get_input(printer, 'Enter a valid reminder or ' '"." to end: ', REMINDER) if r == '.': break n, m = utils.parse_reminder(str(r)) parsed_args.reminders.append(str(n) + ' ' + m)
def run_add_prompt(parsed_args, printer): if parsed_args.title is None: parsed_args.title = get_input(printer, 'Title: ', STR_NOT_EMPTY) if parsed_args.where is None: parsed_args.where = get_input( printer, 'Location: ', STR_ALLOW_EMPTY) if parsed_args.when is None: parsed_args.when = get_input(printer, 'When: ', PARSABLE_DATE) if parsed_args.duration is None: if parsed_args.allday: prompt = 'Duration (days): ' else: prompt = 'Duration (minutes): ' parsed_args.duration = get_input(printer, prompt, STR_TO_INT) if parsed_args.description is None: parsed_args.description = get_input( printer, 'Description: ', STR_ALLOW_EMPTY) if not parsed_args.reminders: while True: r = get_input( printer, 'Enter a valid reminder or ' '"." to end: ', REMINDER) if r == '.': break n, m = utils.parse_reminder(str(r)) parsed_args.reminders.append(str(n) + ' ' + m)