bajillion pep8 fixes to pass tox

This commit is contained in:
Ebag333
2016-12-13 23:31:39 -08:00
parent be53dedb18
commit 28404cd8bb
206 changed files with 3128 additions and 2391 deletions

View File

@@ -1,4 +1,3 @@
import math

View File

@@ -14,6 +14,7 @@ except ImportError:
class OrderedDict(dict):
'Dictionary that remembers insertion order'
# An inherited dict maps keys to values.
# The inherited dict provides __getitem__, __len__, __contains__, and get.
# The remaining methods are order-aware.
@@ -35,7 +36,7 @@ class OrderedDict(dict):
try:
self.__root
except AttributeError:
self.__root = root = [] # sentinel node
self.__root = root = [] # sentinel node
root[:] = [root, root, None]
self.__map = {}
self.__update(*args, **kwds)

View File

@@ -3,7 +3,6 @@ import gui.utils.colorUtils as colorUtils
def RenderGradientBar(windowColor, width, height, sFactor, eFactor, mFactor=None, fillRatio=2):
if sFactor == 0 and eFactor == 0 and mFactor is None:
return DrawFilledBitmap(width, height, windowColor)

View File

@@ -29,7 +29,6 @@ class exportHtml():
class exportHtmlThread(threading.Thread):
def __init__(self, callback=False):
threading.Thread.__init__(self)
self.callback = callback
@@ -192,7 +191,8 @@ class exportHtmlThread(threading.Thread):
fit = fits[0]
try:
dnaFit = sFit.exportDna(fit[0])
HTMLgroup += ' <li><a data-dna="' + dnaFit + '" target="_blank">' + ship.name + ": " + fit[1] + '</a></li>\n'
HTMLgroup += ' <li><a data-dna="' + dnaFit + '" target="_blank">' + ship.name + ": " + \
fit[1] + '</a></li>\n'
except:
pass
finally:
@@ -203,8 +203,9 @@ class exportHtmlThread(threading.Thread):
# Ship group header
HTMLship = (
' <li data-role="collapsible" data-iconpos="right" data-shadow="false" data-corners="false">\n'
' <h2>' + ship.name + ' <span class="ui-li-count">' + str(len(fits)) + '</span></h2>\n'
' <ul data-role="listview" data-shadow="false" data-inset="true" data-corners="false">\n'
' <h2>' + ship.name + ' <span class="ui-li-count">' + str(
len(fits)) + '</span></h2>\n'
' <ul data-role="listview" data-shadow="false" data-inset="true" data-corners="false">\n'
)
for fit in fits:
@@ -212,7 +213,8 @@ class exportHtmlThread(threading.Thread):
return
try:
dnaFit = sFit.exportDna(fit[0])
HTMLship += ' <li><a data-dna="' + dnaFit + '" target="_blank">' + fit[1] + '</a></li>\n'
HTMLship += ' <li><a data-dna="' + dnaFit + '" target="_blank">' + fit[
1] + '</a></li>\n'
except:
continue
finally:
@@ -227,7 +229,7 @@ class exportHtmlThread(threading.Thread):
HTML += (
' <li data-role="collapsible" data-iconpos="right" data-shadow="false" data-corners="false">\n'
' <h2>' + group.groupName + ' <span class="ui-li-count">' + str(groupFits) + '</span></h2>\n'
' <ul data-role="listview" data-shadow="false" data-inset="true" data-corners="false">\n' + HTMLgroup +
' <ul data-role="listview" data-shadow="false" data-inset="true" data-corners="false">\n' + HTMLgroup +
' </ul>\n'
' </li>'
)
@@ -263,7 +265,8 @@ class exportHtmlThread(threading.Thread):
return
try:
dnaFit = sFit.exportDna(fit[0])
HTML += '<a class="outOfGameBrowserLink" target="_blank" href="' + dnaUrl + dnaFit + '">' + ship.name + ': ' + fit[1] + '</a><br> \n'
HTML += '<a class="outOfGameBrowserLink" target="_blank" href="' + dnaUrl + dnaFit + '">' + ship.name + ': ' + \
fit[1] + '</a><br> \n'
except:
continue
finally:

View File

@@ -34,7 +34,7 @@ def formatAmount(val, prec=3, lowest=0, highest=0, currency=False, forceSign=Fal
# Start from highest possible suffix
for key in posOrders:
# Find first suitable suffix and check if it's not above highest order
if abs(val) >= 10**key and key <= highest:
if abs(val) >= 10 ** key and key <= highest:
mantissa, suffix = val / float(10 ** key), posSuffixMap[key]
# Do additional step to eliminate results like 999999 => 1000k
# If we're already using our greatest order, we can't do anything useful
@@ -49,7 +49,7 @@ def formatAmount(val, prec=3, lowest=0, highest=0, currency=False, forceSign=Fal
# If it is, bail - we already have acceptable results
break
# Find multiplier to get from one order to another
orderDiff = 10**(prevKey - key)
orderDiff = 10 ** (prevKey - key)
# If rounded mantissa according to our specifications is greater than
# or equal to multiplier
if roundToPrec(mantissa, prec) >= orderDiff:
@@ -67,8 +67,8 @@ def formatAmount(val, prec=3, lowest=0, highest=0, currency=False, forceSign=Fal
except IndexError:
nextKey = 0
# Check if mantissa with next suffix is in range [1, 1000)
if abs(val) < 10**(nextKey) and key >= lowest:
mantissa, suffix = val / float(10**key), negSuffixMap[key]
if abs(val) < 10 ** (nextKey) and key >= lowest:
mantissa, suffix = val / float(10 ** key), negSuffixMap[key]
# Do additional step to eliminate results like 0.9999 => 1000m
# Check if the key we're potentially switching to is greater than our
# upper boundary
@@ -76,7 +76,7 @@ def formatAmount(val, prec=3, lowest=0, highest=0, currency=False, forceSign=Fal
# If it is, leave loop with results we already have
break
# Find the multiplier between current and next order
orderDiff = 10**(nextKey - key)
orderDiff = 10 ** (nextKey - key)
# If rounded mantissa according to our specifications is greater than
# or equal to multiplier
if roundToPrec(mantissa, prec) >= orderDiff: