def checkProxySetUp(): global _activeProxySettings proxyChoices = userchoices.getMediaProxy() if proxyChoices == _activeProxySettings: #if the proxy is already set as specified, or is not set, do nothing return _activeProxySettings = proxyChoices #works because userchoices made a copy if proxyChoices: networking.config.setupProxy(proxyChoices['server'], proxyChoices['port'], proxyChoices['username'], proxyChoices['password'], ) networking.config.useProxy = True else: networking.config.useProxy = False
def checkProxySetUp(): global _activeProxySettings proxyChoices = userchoices.getMediaProxy() if proxyChoices == _activeProxySettings: #if the proxy is already set as specified, or is not set, do nothing return _activeProxySettings = proxyChoices #works because userchoices made a copy if proxyChoices: networking.config.setupProxy( proxyChoices['server'], proxyChoices['port'], proxyChoices['username'], proxyChoices['password'], ) networking.config.useProxy = True else: networking.config.useProxy = False
def confirmSettings(self): confirmText = confirmMediaChoice % {'url': self.url} try: mediaProxy = userchoices.getMediaProxy() proxyURL = mediaProxy['server'] + ':' + mediaProxy['port'] + '\n' proxyText = proxyMediaChoice % proxyURL confirmText += proxyText except KeyError: pass ui = { 'title': self.title, 'body': confirmText + TransMenu.YesNoBack, 'menu': { '1': self.commit, '2': self.stepBack, '<': self.stepBack, } } self.setSubstepEnv(ui)