Permalink
Browse files

Fix search

  • Loading branch information...
1 parent 4b1027b commit 7e652c72892a2683585faf9a3dbca4ad40c1b690 @dialelo committed Jul 29, 2013
Showing with 2 additions and 20 deletions.
  1. +1 −1 setup.py
  2. +1 −19 turses/api/backends.py
View
2 setup.py
@@ -41,7 +41,7 @@
REQUIREMENTS = [
"oauth2",
"urwid",
- "tweepy>=2.0",
+ "tweepy==2.1",
]
if version_info[:2] == (2, 6):
REQUIREMENTS.append("argparse")
View
20 turses/api/backends.py
@@ -78,22 +78,6 @@ def _to_status(status, **kwargs):
return Status(**defaults)
-def _to_status_from_search(status, **kwargs):
- """
- Convert a `tweepy.SearchResult` to a `turses.models.Status`.
- """
- defaults = {
- 'id': status.id,
- 'created_at': status.created_at,
- 'user': status.from_user,
- 'text': status.text,
- 'entities': getattr(status, 'entities', None),
- }
-
- defaults.update(**kwargs)
- return Status(**defaults)
-
-
def _to_direct_message(dm, **kwargs):
"""
Convert a `tweepy.DirectMessage` to a `turses.models.DirectMessage`.
@@ -158,8 +142,6 @@ def _to_list(a_list, **kwargs):
to_status = partial(filter_result,
filter_func=_to_status)
-to_status_from_search = partial(filter_result,
- filter_func=_to_status_from_search)
to_direct_message = partial(filter_result,
filter_func=_to_direct_message)
to_user = partial(filter_result,
@@ -296,7 +278,7 @@ def belongs_to_conversation(message):
return filter(belongs_to_conversation, messages)
- @to_status_from_search
+ @to_status
@include_entities
def search(self, text, **kwargs):
return self._api.search(text, **kwargs)

0 comments on commit 7e652c7

Please sign in to comment.