@@ -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
@@ -123,7 +123,7 @@ def process(self, http_response, content):
123123
124124class Zencoder (object ):
125125""" This is the entry point to the Zencoder API """
126- def __init__ (self ,api_key = None ,as_xml = False ):
126+ def __init__ (self ,api_key = None ,as_xml = False , timeout = None ):
127127"""
128128 Initializes Zencoder. You must have a valid API_KEY.
129129
@@ -143,9 +143,9 @@ def __init__(self, api_key=None, as_xml=False):
143143self .api_key = api_key
144144
145145self .as_xml = as_xml
146- self .job = Job (self .api_key ,self .as_xml )
147- self .account = Account (self .api_key ,self .as_xml )
148- self .output = Output (self .api_key ,self .as_xml )
146+ self .job = Job (self .api_key ,self .as_xml , timeout = timeout )
147+ self .account = Account (self .api_key ,self .as_xml , timeout = timeout )
148+ self .output = Output (self .api_key ,self .as_xml , timeout = timeout )
149149
150150class Response (object ):
151151"""
@@ -160,11 +160,11 @@ def __init__(self, code, body, raw_body, raw_response):
160160
161161class Account (HTTPBackend ):
162162""" Account object """
163- def __init__ (self ,api_key = None ,as_xml = False ):
163+ def __init__ (self ,api_key = None ,as_xml = False , timeout = None ):
164164"""
165165 Initializes an Account object
166166 """
167- super (Account ,self ).__init__ (api_key ,as_xml ,'account' )
167+ super (Account ,self ).__init__ (api_key ,as_xml ,'account' , timeout = timeout )
168168
169169def create (self ,email ,tos = True ,options = None ):
170170"""
@@ -203,11 +203,11 @@ def live(self):
203203
204204class Output (HTTPBackend ):
205205""" Gets information regarding outputs """
206- def __init__ (self ,api_key ,as_xml = False ):
206+ def __init__ (self ,api_key ,as_xml = False , timeout = None ):
207207"""
208208 Contains all API methods relating to Outputs.
209209 """
210- super (Output ,self ).__init__ (api_key ,as_xml ,'outputs' )
210+ super (Output ,self ).__init__ (api_key ,as_xml ,'outputs' , timeout = timeout )
211211
212212def progress (self ,output_id ):
213213"""
@@ -221,11 +221,11 @@ class Job(HTTPBackend):
221221"""
222222 Contains all API methods relating to transcoding Jobs.
223223 """
224- def __init__ (self ,api_key ,as_xml = False ):
224+ def __init__ (self ,api_key ,as_xml = False , timeout = None ):
225225"""
226226 Initialize a job object
227227 """
228- super (Job ,self ).__init__ (api_key ,as_xml ,'jobs' )
228+ super (Job ,self ).__init__ (api_key ,as_xml ,'jobs' , timeout = timeout )
229229
230230def create (self ,input ,outputs = None ,options = None ):
231231"""