Mercurial > bitten > bitten-test
comparison bitten/slave.py @ 405:b5ab0988694e
The slave logs each request at DEBUG level.
author | cmlenz |
---|---|
date | Fri, 03 Aug 2007 16:37:51 +0000 |
parents | 08801667f00f |
children | 933105ab516b |
comparison
equal
deleted
inserted
replaced
404:0bd6243b350c | 405:b5ab0988694e |
---|---|
85 password_mgr.add_password(None, url, username, password) | 85 password_mgr.add_password(None, url, username, password) |
86 self.opener.add_handler(urllib2.HTTPBasicAuthHandler(password_mgr)) | 86 self.opener.add_handler(urllib2.HTTPBasicAuthHandler(password_mgr)) |
87 self.opener.add_handler(urllib2.HTTPDigestAuthHandler(password_mgr)) | 87 self.opener.add_handler(urllib2.HTTPDigestAuthHandler(password_mgr)) |
88 | 88 |
89 def request(self, method, url, body=None, headers=None): | 89 def request(self, method, url, body=None, headers=None): |
90 log.debug('Sending %s request to %r', body and 'POST' or 'GET', url) | |
90 req = urllib2.Request(url, body, headers or {}) | 91 req = urllib2.Request(url, body, headers or {}) |
91 try: | 92 try: |
92 return self.opener.open(req) | 93 return self.opener.open(req) |
93 except urllib2.HTTPError, e: | 94 except urllib2.HTTPError, e: |
94 if e.code >= 300: | 95 if e.code >= 300: |