Fix update checker, migrate to requests package for all network stuff. The eveapi package is probably not going to work with caching and whatnot, but pyfa doesn't use it and XML API is EOL anyway
This commit is contained in:
@@ -49,13 +49,13 @@ class CheckUpdateThread(threading.Thread):
|
||||
|
||||
try:
|
||||
response = network.request('https://api.github.com/repos/pyfa-org/Pyfa/releases', network.UPDATE)
|
||||
jsonResponse = json.loads(response.read())
|
||||
jsonResponse = response.json()
|
||||
jsonResponse.sort(
|
||||
key=lambda x: calendar.timegm(dateutil.parser.parse(x['published_at']).utctimetuple()),
|
||||
reverse=True
|
||||
)
|
||||
|
||||
for release in jsonResponse:
|
||||
for release in jsonResponse[:5]:
|
||||
rVersion = Version(release['tag_name'])
|
||||
cVersion = Version(config.version)
|
||||
|
||||
@@ -73,8 +73,8 @@ class CheckUpdateThread(threading.Thread):
|
||||
|
||||
if rVersion > cVersion:
|
||||
wx.CallAfter(self.callback, release, rVersion)
|
||||
break
|
||||
|
||||
break
|
||||
except Exception as e:
|
||||
pyfalog.error("Caught exception in run")
|
||||
pyfalog.error(e)
|
||||
|
||||
Reference in New Issue
Block a user