Left: | ||
Right: |
LEFT | RIGHT |
---|---|
1 | 1 |
2 """ | 2 """ |
3 httplib2 | 3 httplib2 |
4 | 4 |
5 A caching http interface that supports ETags and gzip | 5 A caching http interface that supports ETags and gzip |
6 to conserve bandwidth.· | 6 to conserve bandwidth.· |
7 | 7 |
8 Requires Python 3.0 or later | 8 Requires Python 3.0 or later |
9 | 9 |
10 Changelog: | 10 Changelog: |
(...skipping 780 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
791 - caching | 791 - caching |
792 - ETags | 792 - ETags |
793 - compression, | 793 - compression, |
794 - HTTPS | 794 - HTTPS |
795 - Basic | 795 - Basic |
796 - Digest | 796 - Digest |
797 - WSSE | 797 - WSSE |
798 | 798 |
799 and more. | 799 and more. |
800 """ | 800 """ |
801 def __init__(self, cache=None, timeout=None, proxy_info=None, | 801 def __init__(self, cache=None, timeout=None, proxy_info=None, |
jcgregorio_google
2012/09/17 17:46:22
Looks like defaulting to proxyinfo from environmen
dhermes
2012/09/17 17:48:20
Joe,
This never existed before. Can we add this i
| |
802 ca_certs=None, disable_ssl_certificate_validation=False): | 802 ca_certs=None, disable_ssl_certificate_validation=False): |
803 """If 'cache' is a string then it is used as a directory name for | 803 """If 'cache' is a string then it is used as a directory name for |
804 a disk cache. Otherwise it must be an object that supports the | 804 a disk cache. Otherwise it must be an object that supports the |
805 same interface as FileCache. | 805 same interface as FileCache. |
806 | 806 |
807 All timeouts are in seconds. If None is passed for timeout | 807 All timeouts are in seconds. If None is passed for timeout |
808 then Python's default timeout for sockets will be used. See | 808 then Python's default timeout for sockets will be used. See |
809 for example the docs of socket.setdefaulttimeout(): | 809 for example the docs of socket.setdefaulttimeout(): |
810 http://docs.python.org/library/socket.html#socket.setdefaulttimeout | 810 http://docs.python.org/library/socket.html#socket.setdefaulttimeout |
811 | 811 |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
864 | 864 |
865 # Keep Authorization: headers on a redirect. | 865 # Keep Authorization: headers on a redirect. |
866 self.forward_authorization_headers = False | 866 self.forward_authorization_headers = False |
867 | 867 |
868 def __getstate__(self): | 868 def __getstate__(self): |
869 state_dict = copy.copy(self.__dict__) | 869 state_dict = copy.copy(self.__dict__) |
870 # In case request is augmented by some foreign object such as | 870 # In case request is augmented by some foreign object such as |
871 # credentials which handle auth | 871 # credentials which handle auth |
872 if 'request' in state_dict: | 872 if 'request' in state_dict: |
873 del state_dict['request'] | 873 del state_dict['request'] |
874 if 'connections' in state_dict: | |
875 del state_dict['connections'] | |
874 return state_dict | 876 return state_dict |
875 | 877 |
876 def __setstate__(self, state): | 878 def __setstate__(self, state): |
877 self.__dict__.update(state) | 879 self.__dict__.update(state) |
880 self.connections = {} | |
878 | 881 |
879 def _auth_from_challenge(self, host, request_uri, headers, response, content ): | 882 def _auth_from_challenge(self, host, request_uri, headers, response, content ): |
880 """A generator that creates Authorization objects | 883 """A generator that creates Authorization objects |
881 that can be applied to requests. | 884 that can be applied to requests. |
882 """ | 885 """ |
883 challenges = _parse_www_authenticate(response, 'www-authenticate') | 886 challenges = _parse_www_authenticate(response, 'www-authenticate') |
884 for cred in self.credentials.iter(host): | 887 for cred in self.credentials.iter(host): |
885 for scheme in AUTH_SCHEME_ORDER: | 888 for scheme in AUTH_SCHEME_ORDER: |
886 if scheme in challenges: | 889 if scheme in challenges: |
887 yield AUTH_SCHEME_CLASSES[scheme](cred, host, request_uri, h eaders, response, content, self) | 890 yield AUTH_SCHEME_CLASSES[scheme](cred, host, request_uri, h eaders, response, content, self) |
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1282 for key, value in info.items():· | 1285 for key, value in info.items():· |
1283 self[key.lower()] = value· | 1286 self[key.lower()] = value· |
1284 self.status = int(self.get('status', self.status)) | 1287 self.status = int(self.get('status', self.status)) |
1285 | 1288 |
1286 | 1289 |
1287 def __getattr__(self, name): | 1290 def __getattr__(self, name): |
1288 if name == 'dict': | 1291 if name == 'dict': |
1289 return self· | 1292 return self· |
1290 else:·· | 1293 else:·· |
1291 raise AttributeError(name)· | 1294 raise AttributeError(name)· |
LEFT | RIGHT |