Skip to content

Commit

Permalink
Some python 2.5 fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
joshthecoder committed Aug 19, 2009
1 parent 098b5b5 commit 4b1d884
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
4 changes: 2 additions & 2 deletions tweepy/__init__.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
""" """
__version__ = '1.0' __version__ = '1.0'


from . models import * from . models import Status, User, DirectMessage, Friendship, SavedSearch, SearchResult, models
from . error import TweepError from . error import TweepError
from . api import API from . api import API
from . cache import * from . cache import Cache, MemoryCache, FileCache, MemCache
from . auth import BasicAuthHandler, OAuthHandler from . auth import BasicAuthHandler, OAuthHandler
from . streaming import Stream from . streaming import Stream


Expand Down
4 changes: 3 additions & 1 deletion tweepy/api.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
import mimetypes import mimetypes


from . binder import bind_api from . binder import bind_api
from . parsers import *
from . error import TweepError from . error import TweepError
from . auth import BasicAuthHandler, OAuthHandler from . auth import BasicAuthHandler, OAuthHandler
from tweepy.parsers import *


"""Twitter API""" """Twitter API"""
class API(object): class API(object):
Expand Down Expand Up @@ -421,6 +421,8 @@ def trends(self):
parser = parse_trend_results parser = parse_trend_results
)(self) )(self)



""" Pack image file into multipart-formdata request"""
def _pack_image(filename, max_size): def _pack_image(filename, max_size):
"""Pack image from file into multipart-formdata post body""" """Pack image from file into multipart-formdata post body"""
# image must be less than 700kb in size # image must be less than 700kb in size
Expand Down
5 changes: 3 additions & 2 deletions tweepy/binder.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -75,10 +75,11 @@ def _call(api, *args, **kargs):
return cache_result return cache_result


# Open connection # Open connection
# FIXME: add timeout
if api.secure: if api.secure:
conn = httplib.HTTPSConnection(_host, timeout=10.0) conn = httplib.HTTPSConnection(_host)
else: else:
conn = httplib.HTTPConnection(_host, timeout=10.0) conn = httplib.HTTPConnection(_host)


# Build request # Build request
conn.request(method, url, headers=headers, body=post_data) conn.request(method, url, headers=headers, body=post_data)
Expand Down

0 comments on commit 4b1d884

Please sign in to comment.