MCPcopy Index your code
hub / github.com/pyfa-org/Pyfa / getProxySettingsInRequestsFormat

Method getProxySettingsInRequestsFormat

service/settings.py:269–284  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

267 self.serviceNetworkSettings["password"] = password
268
269 def getProxySettingsInRequestsFormat(self) -> dict:
270 proxies = {}
271 proxy_settings = self.getProxySettings()
272 if proxy_settings is not None:
273 # form proxy address in format "http://host:port
274 proxy_host_port = '{}:{}'.format(proxy_settings[0], proxy_settings[1])
275 proxy_auth_details = self.getProxyAuthDetails()
276 user_pass = ''
277 if proxy_auth_details is not None:
278 # construct prefix in form "user:password@"
279 user_pass = '{}:{}@'.format(proxy_auth_details[0], proxy_auth_details[1])
280 proxies = {
281 'http': 'http://' + user_pass + proxy_host_port,
282 'https': 'http://' + user_pass + proxy_host_port
283 }
284 return proxies
285
286
287class HTMLExportSettings:

Callers 2

__getProxiesMethod · 0.80
__init__Method · 0.80

Calls 2

getProxySettingsMethod · 0.95
getProxyAuthDetailsMethod · 0.95

Tested by

no test coverage detected