Fixed the the way proxy settings is sent to eveapi

This commit is contained in:
HomeWorld
2011-12-23 22:02:39 +02:00
parent fb46f742dd
commit c51a1400e1
3 changed files with 9 additions and 8 deletions

View File

@@ -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"

View File

@@ -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):

View File

@@ -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