Given a list of strings representing environment variables, prepend the environment variables corresponding to the proxy settings.
(self, environment)
| 54 | return env |
| 55 | |
| 56 | def inject_proxy_environment(self, environment): |
| 57 | ''' |
| 58 | Given a list of strings representing environment variables, prepend the |
| 59 | environment variables corresponding to the proxy settings. |
| 60 | ''' |
| 61 | if not self: |
| 62 | return environment |
| 63 | |
| 64 | proxy_env = format_environment(self.get_environment()) |
| 65 | if not environment: |
| 66 | return proxy_env |
| 67 | # It is important to prepend our variables, because we want the |
| 68 | # variables defined in "environment" to take precedence. |
| 69 | return proxy_env + environment |
| 70 | |
| 71 | def __str__(self): |
| 72 | return ( |