Use get_tweet in ocr function. Fixes #105

This commit is contained in:
Manuel Cortez 2017-01-24 09:21:19 -06:00
parent 1fd90be4cb
commit 05c0fefc01
2 changed files with 2 additions and 1 deletions

View File

@ -3,6 +3,7 @@
## changes in this version ## changes in this version
* Fixed a bug in long tweet parsing that was making TWBlue to disconnect the streaming API. [#103](https://github.com/manuelcortez/TWBlue/issues/103) * Fixed a bug in long tweet parsing that was making TWBlue to disconnect the streaming API. [#103](https://github.com/manuelcortez/TWBlue/issues/103)
* Now OCR will work in images from retweets. It fixes a bug where TWBlue was detecting images but couldn't apply OCR on them. [#105](https://github.com/manuelcortez/TWBlue/issues/105)
## Changes in version 0.88 and 0.89 ## Changes in version 0.88 and 0.89

View File

@ -1527,7 +1527,7 @@ class Controller(object):
if hasattr(buffer, "get_right_tweet") == False: if hasattr(buffer, "get_right_tweet") == False:
output.speak(_(u"Invalid buffer")) output.speak(_(u"Invalid buffer"))
return return
tweet = buffer.get_right_tweet() tweet = buffer.get_tweet()
if tweet.has_key("entities") == False or tweet["entities"].has_key("media") == False: if tweet.has_key("entities") == False or tweet["entities"].has_key("media") == False:
output.speak(_(u"This tweet doesn't contain images")) output.speak(_(u"This tweet doesn't contain images"))
return return