@@ -31,7 +31,7 @@ class HTTPBackend(object):
3131
3232 @FIXME: Build in support for supplying arbitrary backends
3333 """
34- def __init__ (self ,api_key ,as_xml = False ,resource_name = None ):
34+ def __init__ (self ,api_key ,as_xml = False ,resource_name = None , timeout = None ):
3535"""
3636 Creates an HTTPBackend object, which abstracts out some of the
3737 library specific HTTP stuff.
@@ -41,7 +41,7 @@ def __init__(self, api_key, as_xml=False, resource_name=None):
4141self .base_url = self .base_url + resource_name
4242
4343#TODO investigate httplib2 caching and if it is necessary
44- self .http = httplib2 .Http ()
44+ self .http = httplib2 .Http (timeout = timeout )
4545self .as_xml = as_xml
4646self .api_key = api_key
4747
@@ -122,7 +122,7 @@ def process(self, http_response, content):
122122
123123class Zencoder (object ):
124124""" This is the entry point to the Zencoder API """
125- def __init__ (self ,api_key = None ,as_xml = False ):
125+ def __init__ (self ,api_key = None ,as_xml = False , timeout = None ):
126126"""
127127 Initializes Zencoder. You must have a valid API_KEY.
128128
@@ -142,9 +142,9 @@ def __init__(self, api_key=None, as_xml=False):
142142self .api_key = api_key
143143
144144self .as_xml = as_xml
145- self .job = Job (self .api_key ,self .as_xml )
146- self .account = Account (self .api_key ,self .as_xml )
147- self .output = Output (self .api_key ,self .as_xml )
145+ self .job = Job (self .api_key ,self .as_xml , timeout = timeout )
146+ self .account = Account (self .api_key ,self .as_xml , timeout = timeout )
147+ self .output = Output (self .api_key ,self .as_xml , timeout = timeout )
148148
149149class Response (object ):
150150"""
@@ -159,11 +159,11 @@ def __init__(self, code, body, raw_body, raw_response):
159159
160160class Account (HTTPBackend ):
161161""" Account object """
162- def __init__ (self ,api_key = None ,as_xml = False ):
162+ def __init__ (self ,api_key = None ,as_xml = False , timeout = None ):
163163"""
164164 Initializes an Account object
165165 """
166- super (Account ,self ).__init__ (api_key ,as_xml ,'account' )
166+ super (Account ,self ).__init__ (api_key ,as_xml ,'account' , timeout = timeout )
167167
168168def create (self ,email ,tos = True ,options = None ):
169169"""
@@ -204,11 +204,11 @@ def live(self):
204204
205205class Output (HTTPBackend ):
206206""" Gets information regarding outputs """
207- def __init__ (self ,api_key ,as_xml = False ):
207+ def __init__ (self ,api_key ,as_xml = False , timeout = None ):
208208"""
209209 Contains all API methods relating to Outputs.
210210 """
211- super (Output ,self ).__init__ (api_key ,as_xml ,'outputs' )
211+ super (Output ,self ).__init__ (api_key ,as_xml ,'outputs' , timeout = timeout )
212212
213213def progress (self ,output_id ):
214214"""
@@ -222,11 +222,11 @@ class Job(HTTPBackend):
222222"""
223223 Contains all API methods relating to transcoding Jobs.
224224 """
225- def __init__ (self ,api_key ,as_xml = False ):
225+ def __init__ (self ,api_key ,as_xml = False , timeout = None ):
226226"""
227227 Initialize a job object
228228 """
229- super (Job ,self ).__init__ (api_key ,as_xml ,'jobs' )
229+ super (Job ,self ).__init__ (api_key ,as_xml ,'jobs' , timeout = timeout )
230230
231231def create (self ,input ,outputs = None ,options = None ):
232232"""