brobsc / easy_tst

easy_tst
GNU Affero General Public License v3.0
2 stars 0 forks source link

Check tst login status right on startup #9

Closed brobsc closed 6 years ago

brobsc commented 6 years ago

Currently this happens:

$ › easy_tst                                                                                         ~/easy_tst master
Starting watch mode.
Trying to checkout: "5m8l"
Traceback (most recent call last):
  File "/usr/local/bin/easy_tst", line 6, in <module>
    exec(compile(open(__file__).read(), __file__, 'exec'))
  File "/Users/bruno/easy_tst/bin/easy_tst", line 22, in <module>
    easy_clipboard.watch_mode()
  File "/Users/bruno/easy_tst/easy_tst/easy_clipboard.py", line 44, in watch_mode
    checkout_from_clipboard()
  File "/Users/bruno/easy_tst/easy_tst/easy_clipboard.py", line 22, in checkout_from_clipboard
    tst_wrapper.get_exercise_stats(cv)
  File "/Users/bruno/easy_tst/easy_tst/tst_wrapper.py", line 97, in get_exercise_stats
    raise RuntimeError('Not logged in tst.')
RuntimeError: Not logged in tst.

easy_tst should check if you're logged in when starting and break early.

brobsc commented 6 years ago

Since easy_tst has access to clipboard, it could also launch tst login itself, watch if user copies the login code and login on their behalf