diff --git a/gui/builtinPreferenceViews/pyfaGlobalPreferences.py b/gui/builtinPreferenceViews/pyfaGlobalPreferences.py index ff5440df2..21f0330d3 100644 --- a/gui/builtinPreferenceViews/pyfaGlobalPreferences.py +++ b/gui/builtinPreferenceViews/pyfaGlobalPreferences.py @@ -125,8 +125,9 @@ class PFGlobalPref ( PreferenceView): proxy = self.proxySettings.autodetect() - if proxy: - txt = proxy + if proxy is not None: + addr,port = proxy + txt = addr + ":" + str(port) else: txt = "None" diff --git a/service/character.py b/service/character.py index 18b2f0b83..59a80dbab 100644 --- a/service/character.py +++ b/service/character.py @@ -117,10 +117,10 @@ class Character(): ps = service.settings.ProxySettings.getInstance() if ps.getMode() == 0: return None - elif ps.getMode() == 1: + if ps.getMode() == 1: return ps.autodetect() - elif ps.getMode == 2: - return ps.getAddress() + ps.getPort() + if ps.getMode() == 2: + return (ps.getAddress(), int(ps.getPort())) def charList(self, charID, userID, apiKey): diff --git a/service/settings.py b/service/settings.py index ed1e170ab..420434597 100644 --- a/service/settings.py +++ b/service/settings.py @@ -156,7 +156,7 @@ class ProxySettings(): proxydict = urllib2.ProxyHandler().proxies txt = "Auto-detected: " - validPrefixes = ("https", "http") + validPrefixes = ("http", "https") for prefix in validPrefixes: if not prefix in proxydict: @@ -166,8 +166,8 @@ class ProxySettings(): if proxyline[:len(proto)] == proto: proxyline = proxyline[len(proto):] proxAddr, proxPort = proxyline.split(":") - proxPort = proxPort.rstrip("/") - proxy = proto + proxAddr + proxPort + proxPort = int(proxPort.rstrip("/")) + proxy = (proxAddr, proxPort) break return proxy \ No newline at end of file