]> jfr.im git - z_archive/twitter.git/blobdiff - twitter/api.py
Add missing json import.
[z_archive/twitter.git] / twitter / api.py
index 6dca883935fd45eda10ba2bba0ecb9b4005e086d..c0f791ffad2f981294309dfc58cf918edfde8093 100644 (file)
@@ -105,6 +105,8 @@ def wrap_response(response, headers):
     if response_typ is bool:
         # HURF DURF MY NAME IS PYTHON AND I CAN'T SUBCLASS bool.
         response_typ = int
+    elif response_typ is str:
+        return response
 
     class WrappedTwitterResponse(response_typ, TwitterResponse):
         __doc__ = TwitterResponse.__doc__
@@ -115,7 +117,6 @@ def wrap_response(response, headers):
         def __new__(cls, response, headers):
             return response_typ.__new__(cls, response)
 
-
     return WrappedTwitterResponse(response, headers)
 
 
@@ -124,7 +125,7 @@ class TwitterCall(object):
 
     def __init__(
         self, auth, format, domain, callable_cls, uri="",
-        uriparts=None, secure=True):
+        uriparts=None, secure=True, timeout=None):
         self.auth = auth
         self.format = format
         self.domain = domain
@@ -132,6 +133,7 @@ class TwitterCall(object):
         self.uri = uri
         self.uriparts = uriparts
         self.secure = secure
+        self.timeout = timeout
 
     def __getattr__(self, k):
         try:
@@ -140,7 +142,7 @@ class TwitterCall(object):
             def extend_call(arg):
                 return self.callable_cls(
                     auth=self.auth, format=self.format, domain=self.domain,
-                    callable_cls=self.callable_cls, uriparts=self.uriparts \
+                    callable_cls=self.callable_cls, timeout=self.timeout, uriparts=self.uriparts \
                         + (arg,),
                     secure=self.secure)
             if k == "_":