Skip to content

Commit

Permalink
Merge pull request #3 from zachsnow/dev/timeout
Browse files Browse the repository at this point in the history
Expose timeout.
  • Loading branch information
kurttheviking committed Jun 17, 2013
2 parents 842135e + ea275a2 commit e9ad933
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -162,3 +162,9 @@ pip-log.txt

# Mac crap
.DS_Store


#############
## Emacs
#############
*~
4 changes: 2 additions & 2 deletions hipchat/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def get_method(self):
return self.method
return urllib2.Request.get_method(self)

def method(self, url, method="GET", parameters=None):
def method(self, url, method="GET", parameters=None, timeout=None):
method_url = urljoin(self.url, url)

if method == "GET":
Expand All @@ -52,7 +52,7 @@ def method(self, url, method="GET", parameters=None):
method_url = method_url + '?' + query_string

req = self.RequestWithMethod(method_url, http_method=method, data=request_data)
response = self.opener.open(req).read()
response = self.opener.open(req, None, timeout).read()

return json.loads(response)

Expand Down

0 comments on commit e9ad933

Please sign in to comment.