diff --git a/HISTORY.rst b/HISTORY.rst index a044dcf..9f0e559 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -1,6 +1,12 @@ History ------- +2.10.0 (2013-05-xx) +++++++++++++++++++ +- Added ``get_retweeters_ids`` method +- Fixed ``TwythonDeprecationWarning`` on camelCase functions if the camelCase was the same as the PEP8 function (i.e. ``Twython.retweet`` did not change) +- Fixed error message bubbling when error message returned from Twitter was not an array (i.e. if you try to retweet something twice, the error is not found at index 0) + 2.9.1 (2013-05-04) ++++++++++++++++++ diff --git a/setup.py b/setup.py index dd44b6d..42de4b2 100755 --- a/setup.py +++ b/setup.py @@ -4,7 +4,7 @@ import sys from setuptools import setup __author__ = 'Ryan McGrath ' -__version__ = '2.9.1' +__version__ = '2.10.0' packages = [ 'twython', diff --git a/twython/__init__.py b/twython/__init__.py index 4d888fa..6390bcb 100644 --- a/twython/__init__.py +++ b/twython/__init__.py @@ -18,7 +18,7 @@ Questions, comments? ryan@venodesigns.net """ __author__ = 'Ryan McGrath ' -__version__ = '2.9.1' +__version__ = '2.10.0' from .twython import Twython from .streaming import TwythonStreamer diff --git a/twython/endpoints.py b/twython/endpoints.py index 365a0a2..2695af4 100644 --- a/twython/endpoints.py +++ b/twython/endpoints.py @@ -61,6 +61,10 @@ api_table = { 'url': '/statuses/oembed.json', 'method': 'GET', }, + 'get_retweeters_ids': { + 'url': '/statuses/retweeters/ids.json', + 'method': 'GET', + }, # Search diff --git a/twython/twython.py b/twython/twython.py index a3f055f..ae509b5 100644 --- a/twython/twython.py +++ b/twython/twython.py @@ -114,7 +114,7 @@ class Twython(object): self.api_url % self.api_version + fn['url'] ) - if deprecated_key: + if deprecated_key and (deprecated_key != api_call): # Until Twython 3.0.0 and the function is removed.. send deprecation warning warnings.warn( '`%s` is deprecated, please use `%s` instead.' % (deprecated_key, api_call), @@ -169,7 +169,10 @@ class Twython(object): # If there is no error message, use a default. errors = content.get('errors', [{'message': 'An error occurred processing your request.'}]) - error_message = errors[0]['message'] + if errors and isinstance(errors, list): + error_message = errors[0]['message'] + else: + error_message = errors self._last_call['api_error'] = error_message ExceptionType = TwythonError