Fixes #193, fixed when Warning is raised, fixed error raising, version bump

- 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)
This commit is contained in:
Mike Helmick 2013-05-10 21:28:57 -04:00
parent f0f0d12a60
commit 5534ea2480
5 changed files with 17 additions and 4 deletions

View file

@ -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)
++++++++++++++++++

View file

@ -4,7 +4,7 @@ import sys
from setuptools import setup
__author__ = 'Ryan McGrath <ryan@venodesigns.net>'
__version__ = '2.9.1'
__version__ = '2.10.0'
packages = [
'twython',

View file

@ -18,7 +18,7 @@ Questions, comments? ryan@venodesigns.net
"""
__author__ = 'Ryan McGrath <ryan@venodesigns.net>'
__version__ = '2.9.1'
__version__ = '2.10.0'
from .twython import Twython
from .streaming import TwythonStreamer

View file

@ -61,6 +61,10 @@ api_table = {
'url': '/statuses/oembed.json',
'method': 'GET',
},
'get_retweeters_ids': {
'url': '/statuses/retweeters/ids.json',
'method': 'GET',
},
# Search

View file

@ -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.'}])
if errors and isinstance(errors, list):
error_message = errors[0]['message']
else:
error_message = errors
self._last_call['api_error'] = error_message
ExceptionType = TwythonError