예제 #1
0
 def loadConfigurationSettings(self):
     conf = configuration.getConfiguration()
     http = https = user = pas = None
     if conf.hasKey("httpProxy"):
         http = conf.httpProxy
         if conf.hasKey("httpsProxy"): https = conf.httpsProxy
         if conf.hasKey("proxyUser"): user = conf.proxyUser
         if conf.hasKey("proxyPassword"): pas = conf.proxyPassword
         domaindata.set_proxy_environment(http, https, user, pas)
예제 #2
0
    def setProxy(self, event):
        """In case you are located behind a web proxy, this 
        dialog is used to set the os.environment to use it.
        For how settings are loaded in an automatic way refer to
        gui.SetProxyView.
        """
        dlg = self.app.displayDialog(gui.SetProxyView)
        if dlg.ShowModal() == wx.ID_OK:
            logging.debug("Set proxy")
            http = None
            https = None
            usr = None
            pas = None

            if not dlg.http_t.IsEmpty():
                http = dlg.http_t.GetValue()
                logging.debug("set http-proxy to %s" % http)
            else:
                logging.fatal("Missing http-proxy")
                return

            if not dlg.https_t.IsEmpty():
                https = dlg.https_t.GetValue()
                logging.debug("set https-proxy to %s" % https)

            if not dlg.proxyuser_t.IsEmpty():
                usr = dlg.proxyuser_t.GetValue()
                logging.debug("set proxy-username to %s" % usr)

            if not dlg.proxypass_t.IsEmpty():
                pas = dlg.proxypass_t.GetValue()
                logging.debug("set proxy-password to %s" % pas)

            domaindata.set_proxy_environment(http, https, usr, pas)


        else:
            logging.debug("Setting of proxy canceled")

        dlg.Destroy()