Return a dictionary representing the environment variables used to set the proxy settings.
(self)
| 38 | ) |
| 39 | |
| 40 | def get_environment(self): |
| 41 | ''' |
| 42 | Return a dictionary representing the environment variables used to |
| 43 | set the proxy settings. |
| 44 | ''' |
| 45 | env = {} |
| 46 | if self.http: |
| 47 | env['http_proxy'] = env['HTTP_PROXY'] = self.http |
| 48 | if self.https: |
| 49 | env['https_proxy'] = env['HTTPS_PROXY'] = self.https |
| 50 | if self.ftp: |
| 51 | env['ftp_proxy'] = env['FTP_PROXY'] = self.ftp |
| 52 | if self.no_proxy: |
| 53 | env['no_proxy'] = env['NO_PROXY'] = self.no_proxy |
| 54 | return env |
| 55 | |
| 56 | def inject_proxy_environment(self, environment): |
| 57 | ''' |
no outgoing calls