aesophor / py-todo

📋 Lightweight reminder / todo-list in cli
https://www.reddit.com/r/unixporn/comments/9qy35q/oc_pytodo_a_lightweight_reminder_in_cli/
MIT License
107 stars 22 forks source link

Replace f-string with old formatting syntax? #22

Closed aesophor closed 5 years ago

aesophor commented 5 years ago

I received a SyntaxError report from a user (related to f-string)

gcg@gcg:~/Documents/LaTex/CV1/tech inf ecole$ todo
  File "/usr/bin/todo", line 69
    output_str += f"{'This' if weeks_left == 0 else 'Next'} {self.exp_date.strftime('%A')}; "
                                                                                            ^
SyntaxError: invalid syntax

gcg@gcg:~/Documents/LaTex/CV1/tech inf ecole$ python --version
Python 3.6.7

My test result:

Maybe it's because the user's /usr/bin/env python3 is invoking python3.5 somehow? I think it would be better if we replace f-string with old formatting syntax, so that users that has python < 3.6 can also use py-todo.

aesophor commented 5 years ago

Replaced in d44f21c8d2d62ad7901e23c6e7ca587b57f9959a. Closing.