Nic0/tyrs — Issue #100: Crash with favorite
Author: Nic0
Created: 2011-12-02 11:33:00+00:00
State: open

From an email:

> J'ai tenté de mettre un tweet en favori en appuyant sur 'f' (au lieu de 'b'), et j'obtiens l'erreur suivante [1] :
> AttributeError: 'Interface' object has no attribute 'is_retweet' (ligne 152, dans .../tyrs/tweets.py

> Si j'appuie sur la touche 'f' avant le chargement de la timeline, j'ai l'erreur suivante [2] :
> AttributeError: 'NoneType' object has no attribute 'status' (ligne 158, dans .../tyrs/interface.py)

```python
Traceback (most recent call last):
File "/usr/local/bin/tyrs", line 5, in
pkg_resources.run_script('tyrs==0.6.0', 'tyrs')
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 467, in run_script
self.require(requires)[0].run_script(script_name, ns)
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 1200, in run_script
execfile(script_filename, namespace, namespace)
File "/usr/local/lib/python2.7/dist-packages/tyrs-0.6.0-py2.7.egg/EGG-INFO/scripts/tyrs", line 18, in
main()
File "/usr/local/lib/python2.7/dist-packages/tyrs-0.6.0-py2.7.egg/tyrs/tyrs.py", line 61, in main
init_tyrs()
File "/usr/local/lib/python2.7/dist-packages/tyrs-0.6.0-py2.7.egg/tyrs/tyrs.py", line 66, in init_tyrs
init_interface()
File "/usr/local/lib/python2.7/dist-packages/tyrs-0.6.0-py2.7.egg/tyrs/tyrs.py", line 83, in init_interface
user_interface = Interface()
File "/usr/local/lib/python2.7/dist-packages/tyrs-0.6.0-py2.7.egg/tyrs/interface.py", line 46, in __init__
self.main_loop()
File "/usr/local/lib/python2.7/dist-packages/tyrs-0.6.0-py2.7.egg/tyrs/interface.py", line 59, in main_loop
self.loop.run()
File "/usr/lib/pymodules/python2.7/urwid/main_loop.py", line 170, in run
self.screen.run_wrapper(self._run)
File "/usr/lib/pymodules/python2.7/urwid/raw_display.py", line 234, in run_wrapper
return fn()
File "/usr/lib/pymodules/python2.7/urwid/main_loop.py", line 188, in _run
self.event_loop.run()
File "/usr/lib/pymodules/python2.7/urwid/main_loop.py", line 498, in run
self._loop()
File "/usr/lib/pymodules/python2.7/urwid/main_loop.py", line 523, in _loop
self._watch_files[fd]()
File "/usr/lib/pymodules/python2.7/urwid/main_loop.py", line 234, in _update
self.process_input(keys)
File "/usr/lib/pymodules/python2.7/urwid/main_loop.py", line 323, in process_input
self.unhandled_input(k)
File "/usr/lib/pymodules/python2.7/urwid/main_loop.py", line 350, in unhandled_input
return self._unhandled_input(input)
File "/usr/local/lib/python2.7/dist-packages/tyrs-0.6.0-py2.7.egg/tyrs/keys.py", line 79, in keystroke
self.api.follow_selected()
File "/usr/local/lib/python2.7/dist-packages/tyrs-0.6.0-py2.7.egg/tyrs/tweets.py", line 152, in follow_selected
if self.interface.is_retweet(status):
AttributeError: 'Interface' object has no attribute 'is_retweet'
[et là le curseur est en attente indéfiniment]

[2] :
Traceback (most recent call last):
File "/usr/local/bin/tyrs", line 5, in
pkg_resources.run_script('tyrs==0.6.0', 'tyrs')
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 467, in run_script
self.require(requires)[0].run_script(script_name, ns)
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 1200, in run_script
execfile(script_filename, namespace, namespace)
File "/usr/local/lib/python2.7/dist-packages/tyrs-0.6.0-py2.7.egg/EGG-INFO/scripts/tyrs", line 18, in
main()
File "/usr/local/lib/python2.7/dist-packages/tyrs-0.6.0-py2.7.egg/tyrs/tyrs.py", line 61, in main
init_tyrs()
File "/usr/local/lib/python2.7/dist-packages/tyrs-0.6.0-py2.7.egg/tyrs/tyrs.py", line 66, in init_tyrs
init_interface()
File "/usr/local/lib/python2.7/dist-packages/tyrs-0.6.0-py2.7.egg/tyrs/tyrs.py", line 83, in init_interface
user_interface = Interface()
File "/usr/local/lib/python2.7/dist-packages/tyrs-0.6.0-py2.7.egg/tyrs/interface.py", line 46, in __init__
self.main_loop()
File "/usr/local/lib/python2.7/dist-packages/tyrs-0.6.0-py2.7.egg/tyrs/interface.py", line 59, in main_loop
self.loop.run()
File "/usr/lib/pymodules/python2.7/urwid/main_loop.py", line 170, in run
self.screen.run_wrapper(self._run)
File "/usr/lib/pymodules/python2.7/urwid/raw_display.py", line 234, in run_wrapper
return fn()
File "/usr/lib/pymodules/python2.7/urwid/main_loop.py", line 188, in _run
self.event_loop.run()
File "/usr/lib/pymodules/python2.7/urwid/main_loop.py", line 498, in run
self._loop()
File "/usr/lib/pymodules/python2.7/urwid/main_loop.py", line 523, in _loop
self._watch_files[fd]()
File "/usr/lib/pymodules/python2.7/urwid/main_loop.py", line 234, in _update
self.process_input(keys)
File "/usr/lib/pymodules/python2.7/urwid/main_loop.py", line 323, in process_input
self.unhandled_input(k)
File "/usr/lib/pymodules/python2.7/urwid/main_loop.py", line 350, in unhandled_input
return self._unhandled_input(input)
File "/usr/local/lib/python2.7/dist-packages/tyrs-0.6.0-py2.7.egg/tyrs/keys.py", line 79, in keystroke
self.api.follow_selected()
File "/usr/local/lib/python2.7/dist-packages/tyrs-0.6.0-py2.7.egg/tyrs/tweets.py", line 151, in follow_selected
status = self.interface.current_status()
File "/usr/local/lib/python2.7/dist-packages/tyrs-0.6.0-py2.7.egg/tyrs/interface.py", line 158, in current_status
return focus.status
AttributeError: 'NoneType' object has no attribute 'status'
Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 552, in __bootstrap_inner
self.run()
File "/usr/local/lib/python2.7/dist-packages/tyrs-0.6.0-py2.7.egg/tyrs/update.py", line 34, in run
self.update_timeline()
File "/usr/local/lib/python2.7/dist-packages/tyrs-0.6.0-py2.7.egg/tyrs/update.py", line 57, in update_timeline
self.api.update_timeline(t)
File "/usr/local/lib/python2.7/dist-packages/tyrs-0.6.0-py2.7.egg/tyrs/tweets.py", line 208, in update_timeline
statuses = self.retreive_statuses(timeline)
File "/usr/local/lib/python2.7/dist-packages/tyrs-0.6.0-py2.7.egg/tyrs/tweets.py", line 249, in retreive_statuses
self.interface.erase_flash_message()
File "/usr/local/lib/python2.7/dist-packages/tyrs-0.6.0-py2.7.egg/tyrs/interface.py", line 129, in erase_flash_message
self.display_flash_message()
File "/usr/local/lib/python2.7/dist-packages/tyrs-0.6.0-py2.7.egg/tyrs/interface.py", line 124, in display_flash_message
self.redraw_screen()
File "/usr/local/lib/python2.7/dist-packages/tyrs-0.6.0-py2.7.egg/tyrs/interface.py", line 118, in redraw_screen
self.loop.draw_screen()
File "/usr/lib/pymodules/python2.7/urwid/main_loop.py", line 362, in draw_screen
self.screen.draw_screen(self.screen_size, canvas)
File "/usr/lib/pymodules/python2.7/urwid/raw_display.py", line 531, in draw_screen
assert self._started
AssertionError
```