chishui / terminal-leetcode

Terminal-Leetcode is a terminal based leetcode website viewer.
MIT License
256 stars 27 forks source link

Toast Error #21

Closed jhshi closed 7 years ago

jhshi commented 7 years ago
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner      """
    self.run()
  File "/usr/lib/python2.7/threading.py", line 763, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/usr/local/lib/python2.7/dist-packages/leetcode/terminal.py", line 242, in run_send_code
    toast = Toast('error: %s' % e)
TypeError: __init__() takes at least 4 arguments (2 given)

It seems we missed self.current_view and self.loop when initializing Toast?

chishui commented 7 years ago

Yes, we did. There's a minor issue for your pull request, that the second parameter the length of the text doesn't match e

jhshi commented 7 years ago

Updated PR. Set width according to str(e).