so many pep8 fixes

(cherry picked from commit bee125d)
This commit is contained in:
a-tal
2016-12-03 17:04:12 -08:00
committed by Ebag333
parent 510492e5e9
commit d3b6bc1c93
133 changed files with 3371 additions and 3319 deletions

View File

@@ -1,4 +1,4 @@
#===============================================================================
# =============================================================================
# Copyright (C) 2014 Ryan Holmes
#
# This file is part of pyfa.
@@ -15,7 +15,7 @@
#
# You should have received a copy of the GNU General Public License
# along with pyfa. If not, see <http://www.gnu.org/licenses/>.
#===============================================================================
# =============================================================================
import threading
import json
@@ -28,6 +28,7 @@ import config
from service.network import Network
from service.settings import UpdateSettings
class CheckUpdateThread(threading.Thread):
def __init__(self, callback):
threading.Thread.__init__(self)
@@ -49,7 +50,7 @@ class CheckUpdateThread(threading.Thread):
continue
# Handle use-case of updating to suppressed version
if self.settings.get('version') == 'v'+config.version:
if self.settings.get('version') == 'v' + config.version:
self.settings.set('version', None)
# Suppress version
@@ -63,15 +64,15 @@ class CheckUpdateThread(threading.Thread):
rVersion = release['tag_name'].replace('v', '', 1)
if config.tag is 'git' and not release['prerelease'] and self.versiontuple(rVersion) >= self.versiontuple(config.version):
wx.CallAfter(self.callback, release) # git (dev/Singularity) -> Stable
wx.CallAfter(self.callback, release) # git (dev/Singularity) -> Stable
elif config.expansionName is not "Singularity":
if release['prerelease']:
wx.CallAfter(self.callback, release) # Stable -> Singularity
wx.CallAfter(self.callback, release) # Stable -> Singularity
elif self.versiontuple(rVersion) > self.versiontuple(config.version):
wx.CallAfter(self.callback, release) # Stable -> Stable
wx.CallAfter(self.callback, release) # Stable -> Stable
else:
if release['prerelease'] and rVersion > config.expansionVersion:
wx.CallAfter(self.callback, release) # Singularity -> Singularity
wx.CallAfter(self.callback, release) # Singularity -> Singularity
break
except:
pass
@@ -79,10 +80,9 @@ class CheckUpdateThread(threading.Thread):
def versiontuple(self, v):
return tuple(map(int, (v.split("."))))
class Update():
instance = None
def __init__(self):
pass
def CheckUpdate(self, callback):
thread = CheckUpdateThread(callback)
@@ -90,6 +90,6 @@ class Update():
@classmethod
def getInstance(cls):
if cls.instance == None:
if cls.instance is None:
cls.instance = Update()
return cls.instance