* Updated all methods to use the internal get/post methods
* isListMember was using the deprecated *GET
:user/:list_id/members/:id* Twitter endpoint
* isListMember was also using a deprecated method
* Changed documentation on methods, the first line should be what the
method does (docstring)
* Started to change documentation for methods to use rst (restructed
text) -- What PyPi supports as well as Sphinx generator and others
instead of Markdown
* Planning to get rid of Exceptions - TwythonAPILimit, APILimit,
AuthError and Methods - searchTwitter(), searchTwitterGen()
Changed the TwythonError to stash the error_code into self, one or two raises of TwythonError didn't pass in the status code, updated them to do so. (work by @jvanasco)
I still think it's weird to have them, but I'm not against giving the
user more information. I put back in the twitter_http_status_codes
variable, but I changed where the logic was being handled, instead of
it happening the in _request, it will be asserted in Twython error if
an error_code is passed AND the error_code is in
twitter_http_status_codes
* Removed twitter_http_status_codes. Unnecessary variable when we are
giving them the error back.
* Added a "Please see..." message to TwythonError if the exception
passes an error code, linking to Twitter API error response page.
* Merged stuff from constructFunc into _request()
- added twitter's http status codes to twitter_endpoints.py ( dict index on status code, value is a tuple of name + description )
- created an internal stash called '_last_call' that stores details of the last api call ( the call, response data, headers, url, etc )
- better error handling for api issues:
- - raises an error when the status code is not 200 or 304
- - raises TwythonAPILimit when a 420 rate limit code is returned
- - raises a TwythonError on other issues, setting the correct status code and using messages that are from the twitter API
- wraps a successful read in a try/except block. there's an error i haven't been able to reproduce where invalid content can get in there, it would be nice to catch it and write a handler for it. ( the previous functions were all introducted to allow this to be debugged )
- added a 'get_lastfunction_header' method. if the API has not been called yet , raises a TwythonError. otherwise it attempts to return the header value twitter last sent. useful for x-ratelimit-limit , x-ratelimit-remaining , x-ratelimit-class , x-ratelimit-reset
* Changed the importing order for simplejson, if they have the library
installed, chances are they're going to want to use that over Python
json, json is slower than simplejson
* Version passing is now avaliable
* Catching json decode errors (ValueError) and Twitter Errors on
`_request` method and returning content rather than the response object.
Just in case Twitter releases something in their API and a developer
wants to implement it on their app, but we haven't gotten around to
putting it in Twython yet. :)
- requests is now the default url/http library, thanks to Mike Helmick
- Initial pass at a Streaming API is now included (Twython.stream()), due to how easy
requests makes it. Would actually be sad if we *didn't* have this... thanks, Kenneth. >_>;
- Return of shortenURL, for people who may have relied on it before.
- Deleted streaming handler that existed before but never got implemented fully.
- Exceptions now prefixed with Twython, but brought back originals with a more verbose error directing
people to new ones, deprecate fully in future.
- Twython3k now has an OAuth fix for callback_urls, though it still relies on httplib2. Thanks @jbouvier!
- Added a list of contributors to the README files, something which I should have done long ago. Thank you all.
* Removed shortenUrl since Twitter ALWAYS shortens the URL to a t.co,
anyways.
* Since removing shortenUrl, no need for urllib2 anymore
* No need for httplib2 anymore, either
* Rid of a lot of libs not being used
* Changing Exceptions to prefix with "Twython", just safer in case
other apps have "AuthError", etc. for some reason.
* You can now update user profile image or user profile background
image thanks to the Python requests library.
* Updated setup to include 'requests' as a required package
* Changed to beginning hashbang to use the users environment python
version
* try/except for parse_qsl, removed try/excepts where it used
cgi.parse_qsl/urlparse.parse_sql
* Lines 161/162 (using self.consumer/token) <- this addition ended up
not being needed, but it doesn't hurt.
* updateProfileBackgroundImage() - param 'tile' is now True/False
rather than a string "true" or string "false"
* removed encode_multipart_formdata func, not needed any longer
Swap out the hilariously fun method_missing clone for a more debug-able version that registers endpoints directly, thanks to @mhameed. Should make life easier for people...