From 4b1d884ee8c4de6b4938fb2dcd5d55c48e972ac8 Mon Sep 17 00:00:00 2001 From: Josh Roesslein Date: Wed, 19 Aug 2009 14:28:35 -0500 Subject: [PATCH] Some python 2.5 fixes. --- tweepy/__init__.py | 4 ++-- tweepy/api.py | 4 +++- tweepy/binder.py | 5 +++-- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/tweepy/__init__.py b/tweepy/__init__.py index d3d67d9..3d70bfa 100644 --- a/tweepy/__init__.py +++ b/tweepy/__init__.py @@ -7,10 +7,10 @@ Tweepy Twitter API library """ __version__ = '1.0' -from . models import * +from . models import Status, User, DirectMessage, Friendship, SavedSearch, SearchResult, models from . error import TweepError from . api import API -from . cache import * +from . cache import Cache, MemoryCache, FileCache, MemCache from . auth import BasicAuthHandler, OAuthHandler from . streaming import Stream diff --git a/tweepy/api.py b/tweepy/api.py index 03cd2dc..115b65d 100644 --- a/tweepy/api.py +++ b/tweepy/api.py @@ -6,9 +6,9 @@ import os import mimetypes from . binder import bind_api -from . parsers import * from . error import TweepError from . auth import BasicAuthHandler, OAuthHandler +from tweepy.parsers import * """Twitter API""" class API(object): @@ -421,6 +421,8 @@ class API(object): parser = parse_trend_results )(self) + +""" Pack image file into multipart-formdata request""" def _pack_image(filename, max_size): """Pack image from file into multipart-formdata post body""" # image must be less than 700kb in size diff --git a/tweepy/binder.py b/tweepy/binder.py index 9fe2432..0c2ce42 100644 --- a/tweepy/binder.py +++ b/tweepy/binder.py @@ -75,10 +75,11 @@ def bind_api(path, parser, allowed_param=None, method='GET', require_auth=False, return cache_result # Open connection + # FIXME: add timeout if api.secure: - conn = httplib.HTTPSConnection(_host, timeout=10.0) + conn = httplib.HTTPSConnection(_host) else: - conn = httplib.HTTPConnection(_host, timeout=10.0) + conn = httplib.HTTPConnection(_host) # Build request conn.request(method, url, headers=headers, body=post_data) -- 2.25.1