Home
last modified time | relevance | path

Searched refs:urllib2 (Results 1 – 25 of 154) sorted by relevance

1234567

/external/toolchain-utils/cwp/bartlett/test/
Dserver_tester.py12 import urllib2
30 self.opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(self._jar))
56 request = urllib2.Request(SERVER_URL + 'upload', datagen, headers)
57 response = urllib2.urlopen(request).read()
62 request = urllib2.Request(AUTH_URL % (SERVER_URL + 'serve'))
67 request = urllib2.Request(AUTH_URL % (SERVER_URL + 'serve/' + key))
74 request = urllib2.Request(AUTH_URL % (SERVER_URL + 'del/' + key))
76 request = urllib2.Request(AUTH_URL % (SERVER_URL + 'serve'))
91 request = urllib2.Request(SERVER_URL + 'serve')
92 response = urllib2.urlopen(request).read()
[all …]
/external/python/cpython2/Lib/test/
Dtest_urllib2.py9 import urllib2
10 from urllib2 import Request, OpenerDirector, AbstractDigestAuthHandler
27 self.assertRaises(ValueError, urllib2.urlopen, 'bogus url')
30 fname = os.path.abspath(urllib2.__file__).replace(os.sep, '/')
44 f = urllib2.urlopen(file_url)
55 self.assertEqual(urllib2.parse_http_list(string), list)
61 urllib2.urlopen(
362 raise urllib2.URLError("blah")
411 class MockHTTPHandler(urllib2.BaseHandler):
437 class MockHTTPSHandler(urllib2.AbstractHTTPHandler):
[all …]
Dtest_urllib2_localnet.py4 import urllib2
305 ah = urllib2.HTTPBasicAuthHandler()
307 urllib2.install_opener(urllib2.build_opener(ah))
309 self.assertTrue(urllib2.urlopen(self.server_url))
310 except urllib2.HTTPError:
316 ah = urllib2.HTTPBasicAuthHandler()
319 urllib2.install_opener(urllib2.build_opener(ah))
320 self.assertRaises(urllib2.HTTPError, urllib2.urlopen, self.server_url)
351 handler = urllib2.ProxyHandler({"http" : proxy_url})
352 self.proxy_digest_handler = urllib2.ProxyDigestAuthHandler()
[all …]
Dtest_urllib2net.py6 import urllib2
30 _urlopen_with_retry = _wrap_with_retry_thrice(urllib2.urlopen, urllib2.URLError)
107 None, urllib2.URLError),
119 ('file:///nonsensename/etc/passwd', None, urllib2.URLError),
125 self.assertRaises(ValueError, urllib2.urlopen,'./relative_path/to/file')
158 req = urllib2.Request(urlwith_frag)
159 res = urllib2.urlopen(req)
164 req = urllib2.Request("http://www.example.com")
165 opener = urllib2.build_opener()
177 opener = urllib2.build_opener()
[all …]
/external/autotest/client/common_lib/cros/fake_device_server/client_lib/
Dcommands.py9 import urllib2
29 request = urllib2.Request(self.get_url([command_id]),
31 url_h = urllib2.urlopen(request)
40 request = urllib2.Request(self.get_url(params={'deviceId':device_id}),
42 url_h = urllib2.urlopen(request)
58 request = urllib2.Request(self.get_url([command_id]), json.dumps(data),
65 url_h = urllib2.urlopen(request)
77 request = urllib2.Request(self.get_url(),
80 url_h = urllib2.urlopen(request)
Ddevices.py9 import urllib2
29 request = urllib2.Request(self.get_url([device_id]),
31 url_h = urllib2.urlopen(request)
37 request = urllib2.Request(self.get_url(),
39 url_h = urllib2.urlopen(request)
54 request = urllib2.Request(self.get_url(), json.dumps(data),
56 url_h = urllib2.urlopen(request)
Dregistration.py9 import urllib2
29 url_h = urllib2.urlopen(self.get_url([ticket_id]))
51 request = urllib2.Request(self.get_url([ticket_id]), json.dumps(data),
58 url_h = urllib2.urlopen(request)
73 request = urllib2.Request(self.get_url(), json.dumps(data), headers)
74 url_h = urllib2.urlopen(request)
83 request = urllib2.Request(self.get_url([ticket_id, 'finalize']),
85 url_h = urllib2.urlopen(request)
Dfail_control.py8 import urllib2
26 request = urllib2.Request(self.get_url(['start_failing_requests']),
28 url_h = urllib2.urlopen(request)
35 request = urllib2.Request(self.get_url(['stop_failing_requests']),
37 url_h = urllib2.urlopen(request)
Doauth.py8 import urllib2
26 request = urllib2.Request(self.get_url(['invalidate_all_access_tokens']),
28 url_h = urllib2.urlopen(request)
35 request = urllib2.Request(
38 url_h = urllib2.urlopen(request)
Doauth_helpers.py10 import urllib2
38 request = urllib2.Request(token_url, data=urllib.urlencode(data),
40 url_h = urllib2.urlopen(request)
56 request = urllib2.Request(token_url, data=urllib.urlencode(data),
58 url_h = urllib2.urlopen(request)
Dmeta.py7 import urllib2
30 request = urllib2.urlopen(self.get_url(['generation']), None,
33 except urllib2.URLError:
Dcommon_client.py8 import urllib2
71 params_list.append('='.join([urllib2.quote(kw),
72 urllib2.quote(arg)]))
/external/toolchain-utils/cwp/interpreter/
Dapp_engine_pull.py23 import urllib2
47 opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cookiejar))
48 urllib2.install_opener(opener)
56 auth_req = urllib2.Request(auth_uri, data=authreq_data)
58 auth_resp = urllib2.urlopen(auth_req)
59 except urllib2.URLError:
150 serv_req = urllib2.Request(full_serv_uri)
151 serv_resp = urllib2.urlopen(serv_req)
197 serv_req = urllib2.Request(full_serv_uri)
198 urllib2.urlopen(serv_req)
[all …]
/external/python/cpython2/Doc/howto/
Durllib2.rst4 HOWTO Fetch Internet Resources Using urllib2
12 HOWTO, available at `urllib2 - Le Manuel manquant
29 **urllib2** is a Python module for fetching URLs
36 urllib2 supports fetching URLs for many "URL schemes" (identified by the string
45 not intended to be easy to read. This HOWTO aims to illustrate using *urllib2*,
47 the :mod:`urllib2` docs, but is supplementary to them.
53 The simplest way to use urllib2 is as follows::
55 import urllib2
56 response = urllib2.urlopen('http://python.org/')
59 Many uses of urllib2 will be that simple (note that instead of an 'http:' URL we
[all …]
/external/autotest/client/common_lib/
Dfile_utils.py10 import urllib2
141 proxy_handler = urllib2.ProxyHandler(proxies)
142 opener = urllib2.build_opener(proxy_handler)
143 urllib2.install_opener(opener)
150 remote_file = urllib2.urlopen(remote_path)
156 except urllib2.HTTPError as e:
163 except urllib2.URLError as e:
/external/autotest/site_utils/
Dhwid_lib.py6 import urllib2
57 'hwid': urllib2.quote(hwid),
62 page_contents = urllib2.urlopen(url_request)
63 except (urllib2.URLError, urllib2.HTTPError) as e:
/external/autotest/server/
Dlab_status_unittest.py10 import urllib2
119 self.mox.StubOutWithMock(urllib2, 'urlopen')
127 urllib2.urlopen(mox.IgnoreArg()).AndReturn(
139 urllib2.urlopen(mox.IgnoreArg()).AndRaise(
142 urllib2.urlopen(mox.IgnoreArg()).AndReturn(
154 urllib2.urlopen(mox.IgnoreArg()).AndReturn(
157 urllib2.urlopen(mox.IgnoreArg()).AndReturn(
170 urllib2.urlopen(mox.IgnoreArg()).AndRaise(
184 urllib2.urlopen(mox.IgnoreArg()).AndReturn(
/external/python/cpython2/Lib/distutils/command/
Dregister.py10 import urllib2
89 response = urllib2.urlopen(self.repository+'?:action=list_classifiers')
163 auth = urllib2.HTTPPasswordMgr()
292 req = urllib2.Request(self.repository, body, headers)
295 opener = urllib2.build_opener(
296 urllib2.HTTPBasicAuthHandler(password_mgr=auth)
301 except urllib2.HTTPError, e:
305 except urllib2.URLError, e:
/external/boringssl/src/util/bot/
Dupdate_clang.py16 import urllib2
55 response = urllib2.urlopen(url)
70 raise urllib2.URLError("only got %d of %d bytes" %
74 except urllib2.URLError as e:
77 if num_retries == 0 or isinstance(e, urllib2.HTTPError) and e.code == 404:
190 except urllib2.URLError:
/external/jacoco/.travis/
Dtrigger-site-deployment.py2 import urllib2
6 req = urllib2.Request(url, data)
13 p = urllib2.urlopen(req)
/external/autotest/server/cros/
Dsonic_client_utils.py13 import urllib2
37 RPC_EXCEPTIONS = (httplib.BadStatusLine, socket.error, urllib2.HTTPError)
120 return urllib2.urlopen(url).read()
133 request = urllib2.Request(url, json.dumps(data),
135 urllib2.urlopen(request)
/external/autotest/client/common_lib/cros/
Dchromedriver.py8 import urllib2
86 urllib2.urlopen('http://localhost:%i/json/new' %
210 urllib2.urlopen(self.url + '/status')
212 except urllib2.URLError as e:
232 urllib2.urlopen(self.url + '/shutdown', timeout=10).close()
/external/autotest/tko/
Djsonp_fetcher.cgi3 import cgi, traceback, urllib2
26 file_contents = urllib2.urlopen('http://localhost' + path).read()
28 except urllib2.HTTPError:
/external/autotest/tko/perf_upload/
Dperf_uploader.py21 import urllib2
263 req = urllib2.Request(_DASHBOARD_UPLOAD_URL, encoded)
265 urllib2.urlopen(req)
266 except urllib2.HTTPError as e:
269 except urllib2.URLError as e:
/external/autotest/client/cros/enterprise/
Denterprise_fake_dmserver.py7 import urllib2
64 if urllib2.urlopen('%stest/ping' % self.server_url).getcode() == 200:
65 urllib2.urlopen('%sconfiguration/test/exit' % self.server_url)

1234567