Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filter causes exception #391

Open
HenryHu opened this issue Jan 1, 2016 · 1 comment
Open

Filter causes exception #391

HenryHu opened this issue Jan 1, 2016 · 1 comment

Comments

@HenryHu
Copy link
Contributor

HenryHu commented Jan 1, 2016

If all the messages obtained in one update are filtered out, an exception occurs:

Traceback (most recent call last):
File "/usr/local/lib/python2.7/site-packages/turpial-3.5.9.dev0-py2.7.egg/turpial/ui/qt/main.py", line 772, in after_update_column
self.container.update_column(column.id, updates)
File "/usr/local/lib/python2.7/site-packages/turpial-3.5.9.dev0-py2.7.egg/turpial/ui/qt/container.py", line 231, in update_column
self.columns[column_id].update_statuses(statuses)
File "/usr/local/lib/python2.7/site-packages/turpial-3.5.9.dev0-py2.7.egg/turpial/ui/qt/column.py", line 348, in update_statuses
self.__set_last_status_id(statuses)
File "/usr/local/lib/python2.7/site-packages/turpial-3.5.9.dev0-py2.7.egg/turpial/ui/qt/column.py", line 308, in __set_last_status_id
if statuses[0].repeated_by:
IndexError: list index out of range

The reason is clear. But to fix it, there are problems I'm not sure about:

  • Shall we play update sound in this case?
  • Shall we show notification in this case?
@satanas
Copy link
Owner

satanas commented Jan 1, 2016

Hey @HenryHu,

Yes, we should play the update sound and we should show a notification. For this specific case, notifications module has support to show how many tweets have been filtered. If you check notification.py#L49-L67, you'll see that calling something like:

notify.updates('my-column', 0, 10)

Should show a message like: No new tweets (10 tweets have been filtered). That way we let the user know that there is an active filter that is doing its job.

Any other doubt or concern, do not hesitate to contact me.

Cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants