Exemplo n.º 1
0
Arquivo: ui.py Projeto: Procrat/eva
def pick_date(question: str, replay: str) -> datetime:
    """Prints question and returns a datetime or None."""

    while True:
        answer = ask(question).lower()
        if not answer:
            return None

        date = date_utils.parse(answer)
        if date:
            replay = replay.format(date_utils.format(date))
            if ask_polar_question(replay + '  Affirmative?'):
                return date
        else:
            print("Sorry, I couldn't understand that.")
Exemplo n.º 2
0
Arquivo: db.py Projeto: Procrat/eva
 def __str__(self):
     return '- {} @ {}'.format(self.content, date_utils.format(self.when))