Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf0d6a99

Browse files
committed
Merge branch 'master' ofhttps://github.com/senko/zencoder-py into senko-master
2 parentsa283774 +eccac33 commitf0d6a99

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

‎zencoder/core.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -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):
4141
self.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)
4545
self.as_xml=as_xml
4646
self.api_key=api_key
4747

@@ -123,7 +123,7 @@ def process(self, http_response, content):
123123

124124
classZencoder(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):
143143
self.api_key=api_key
144144

145145
self.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

150150
classResponse(object):
151151
"""
@@ -160,11 +160,11 @@ def __init__(self, code, body, raw_body, raw_response):
160160

161161
classAccount(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

169169
defcreate(self,email,tos=True,options=None):
170170
"""
@@ -203,11 +203,11 @@ def live(self):
203203

204204
classOutput(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

212212
defprogress(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

230230
defcreate(self,input,outputs=None,options=None):
231231
"""

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp