@@ -167,7 +167,7 @@ def __init__(self, api_key=None, api_version=None, as_xml=False, timeout=None, t
167167 Initializes Zencoder. You must have a valid API_KEY.
168168
169169 You can pass in the api_key as an argument, or set
170- ' ZENCODER_API_KEY' as an environment variable, and it will use
170+ ` ZENCODER_API_KEY` as an environment variable, and it will use
171171 that, if api_key is unspecified.
172172
173173 Set api_version='edge' to get the Zencoder development API. (defaults to 'v2')
@@ -190,9 +190,12 @@ def __init__(self, api_key=None, api_version=None, as_xml=False, timeout=None, t
190190
191191self .test = test
192192self .as_xml = as_xml
193- self .job = Job (self .base_url ,self .api_key ,self .as_xml ,timeout = timeout ,test = self .test )
194- self .account = Account (self .base_url ,self .api_key ,self .as_xml ,timeout = timeout )
195- self .output = Output (self .base_url ,self .api_key ,self .as_xml ,timeout = timeout )
193+
194+ args = (self .base_url ,self .api_key ,self .as_xml )
195+ kwargs = dict (timeout = timeout ,test = self .test ,version = api_version )
196+ self .job = Job (* args ,** kwargs )
197+ self .account = Account (* args ,** kwargs )
198+ self .output = Output (* args ,** kwargs )
196199
197200class Response (object ):
198201"""
@@ -207,11 +210,12 @@ def __init__(self, code, body, raw_body, raw_response):
207210
208211class Account (HTTPBackend ):
209212""" Account object """
210- def __init__ (self ,base_url , api_key = None , as_xml = False , timeout = None ):
213+ def __init__ (self ,* args , ** kwargs ):
211214"""
212215 Initializes an Account object
213216 """
214- super (Account ,self ).__init__ (base_url ,api_key ,as_xml ,'account' ,timeout = timeout )
217+ kwargs ['resource_name' ]= 'account'
218+ super (Account ,self ).__init__ (* args ,** kwargs )
215219
216220def create (self ,email ,tos = 1 ,options = None ):
217221"""
@@ -242,19 +246,20 @@ def integration(self):
242246
243247def live (self ):
244248"""
245- Puts your account into live mode."
249+ Puts your account into live mode.
246250 """
247251data = {'api_key' :self .api_key }
248252
249253return self .get (self .base_url + '/live' ,data = data )
250254
251255class Output (HTTPBackend ):
252256""" Gets information regarding outputs """
253- def __init__ (self ,base_url , api_key , as_xml = False , timeout = None ):
257+ def __init__ (self ,* args , ** kwargs ):
254258"""
255259 Contains all API methods relating to Outputs.
256260 """
257- super (Output ,self ).__init__ (base_url ,api_key ,as_xml ,'outputs' ,timeout = timeout )
261+ kwargs ['resource_name' ]= 'outputs'
262+ super (Output ,self ).__init__ (* args ,** kwargs )
258263
259264def progress (self ,output_id ):
260265"""
@@ -276,15 +281,16 @@ class Job(HTTPBackend):
276281"""
277282 Contains all API methods relating to transcoding Jobs.
278283 """
279- def __init__ (self ,base_url , api_key , as_xml = False , timeout = None , test = False ):
284+ def __init__ (self ,* args , ** kwargs ):
280285"""
281- Initialize a job object
286+ Initializes a job object
282287 """
283- super (Job ,self ).__init__ (base_url ,api_key ,as_xml ,'jobs' ,timeout = timeout ,test = test )
288+ kwargs ['resource_name' ]= 'jobs'
289+ super (Job ,self ).__init__ (* args ,** kwargs )
284290
285291def create (self ,input ,outputs = None ,options = None ):
286292"""
287- Create a job
293+ Creates a job
288294
289295 @param input: the input url as string
290296 @param outputs: a list of output dictionaries
@@ -303,7 +309,10 @@ def create(self, input, outputs=None, options=None):
303309
304310def list (self ,page = 1 ,per_page = 50 ):
305311"""
306- List some jobs
312+ Lists some jobs.
313+
314+ @param page: <int> the page of results to return
315+ @param per_page: <int> the number of results per page
307316 """
308317data = {"api_key" :self .api_key ,
309318"page" :page ,