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:
parent
f0f0d12a60
commit
5534ea2480
5 changed files with 17 additions and 4 deletions
|
|
@ -1,6 +1,12 @@
|
||||||
History
|
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)
|
2.9.1 (2013-05-04)
|
||||||
++++++++++++++++++
|
++++++++++++++++++
|
||||||
|
|
||||||
|
|
|
||||||
2
setup.py
2
setup.py
|
|
@ -4,7 +4,7 @@ import sys
|
||||||
from setuptools import setup
|
from setuptools import setup
|
||||||
|
|
||||||
__author__ = 'Ryan McGrath <ryan@venodesigns.net>'
|
__author__ = 'Ryan McGrath <ryan@venodesigns.net>'
|
||||||
__version__ = '2.9.1'
|
__version__ = '2.10.0'
|
||||||
|
|
||||||
packages = [
|
packages = [
|
||||||
'twython',
|
'twython',
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ Questions, comments? ryan@venodesigns.net
|
||||||
"""
|
"""
|
||||||
|
|
||||||
__author__ = 'Ryan McGrath <ryan@venodesigns.net>'
|
__author__ = 'Ryan McGrath <ryan@venodesigns.net>'
|
||||||
__version__ = '2.9.1'
|
__version__ = '2.10.0'
|
||||||
|
|
||||||
from .twython import Twython
|
from .twython import Twython
|
||||||
from .streaming import TwythonStreamer
|
from .streaming import TwythonStreamer
|
||||||
|
|
|
||||||
|
|
@ -61,6 +61,10 @@ api_table = {
|
||||||
'url': '/statuses/oembed.json',
|
'url': '/statuses/oembed.json',
|
||||||
'method': 'GET',
|
'method': 'GET',
|
||||||
},
|
},
|
||||||
|
'get_retweeters_ids': {
|
||||||
|
'url': '/statuses/retweeters/ids.json',
|
||||||
|
'method': 'GET',
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
# Search
|
# Search
|
||||||
|
|
|
||||||
|
|
@ -114,7 +114,7 @@ class Twython(object):
|
||||||
self.api_url % self.api_version + fn['url']
|
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
|
# Until Twython 3.0.0 and the function is removed.. send deprecation warning
|
||||||
warnings.warn(
|
warnings.warn(
|
||||||
'`%s` is deprecated, please use `%s` instead.' % (deprecated_key, api_call),
|
'`%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.
|
# If there is no error message, use a default.
|
||||||
errors = content.get('errors',
|
errors = content.get('errors',
|
||||||
[{'message': 'An error occurred processing your request.'}])
|
[{'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
|
self._last_call['api_error'] = error_message
|
||||||
|
|
||||||
ExceptionType = TwythonError
|
ExceptionType = TwythonError
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue