Fix commit message. LOTS of fixes for flake8.
This commit is contained in:
@@ -4,8 +4,6 @@ Migration 15
|
||||
- Delete projected modules on citadels
|
||||
"""
|
||||
|
||||
import sqlalchemy
|
||||
|
||||
|
||||
def upgrade(saveddata_engine):
|
||||
sql = """
|
||||
|
||||
@@ -4,8 +4,6 @@ Migration 17
|
||||
- Moves all fleet boosters to the new schema
|
||||
"""
|
||||
|
||||
import sqlalchemy
|
||||
|
||||
|
||||
def upgrade(saveddata_engine):
|
||||
from eos.db import saveddata_session
|
||||
|
||||
@@ -4,8 +4,6 @@ Migration 19
|
||||
- Deletes broken references to fits from the commandFits table (see GH issue #844)
|
||||
"""
|
||||
|
||||
import sqlalchemy
|
||||
|
||||
|
||||
def upgrade(saveddata_engine):
|
||||
from eos.db import saveddata_session
|
||||
|
||||
@@ -85,7 +85,8 @@ class DatabaseCleanup:
|
||||
logger.error("More than one uniform damage pattern found.")
|
||||
else:
|
||||
uniform_damage_pattern_id = rows[0]['ID']
|
||||
update_query = "UPDATE 'fits' SET 'damagePatternID' = {} WHERE damagePatternID NOT IN (SELECT ID FROM damagePatterns) OR damagePatternID IS NULL".format(uniform_damage_pattern_id)
|
||||
update_query = "UPDATE 'fits' SET 'damagePatternID' = {} " \
|
||||
"WHERE damagePatternID NOT IN (SELECT ID FROM damagePatterns) OR damagePatternID IS NULL".format(uniform_damage_pattern_id)
|
||||
update_results = DatabaseCleanup.ExecuteSQLQuery(saveddata_engine, update_query)
|
||||
logger.error("Database corruption found. Cleaning up %d records.", update_results.rowcount)
|
||||
|
||||
|
||||
@@ -504,8 +504,8 @@ class Miscellanea(ViewColumn):
|
||||
for number_of_cycles in {5, 10, 25}:
|
||||
tooltip = "{0}\n{1} charges lasts {2} seconds ({3} cycles)".format(
|
||||
tooltip,
|
||||
formatAmount(number_of_cycles*cycles, 3, 0, 3),
|
||||
formatAmount((duration+reload_time)*number_of_cycles, 3, 0, 3),
|
||||
formatAmount(number_of_cycles * cycles, 3, 0, 3),
|
||||
formatAmount((duration + reload_time) * number_of_cycles, 3, 0, 3),
|
||||
formatAmount(number_of_cycles, 3, 0, 3)
|
||||
)
|
||||
text = "{0} / {1}s (+{2}s)".format(
|
||||
|
||||
@@ -31,7 +31,7 @@ from gui.builtinViewColumns.state import State
|
||||
from gui.bitmapLoader import BitmapLoader
|
||||
import gui.builtinViews.emptyView
|
||||
from gui.utils.exportHtml import exportHtml
|
||||
from logging import getLogger, Formatter
|
||||
from logging import getLogger
|
||||
|
||||
from service.fit import Fit
|
||||
from service.market import Market
|
||||
|
||||
@@ -58,7 +58,7 @@ class ContextMenu(object):
|
||||
rootMenu.selection = (selection,) if not hasattr(selection, "__iter__") else selection
|
||||
empty = True
|
||||
for i, fullContext in enumerate(fullContexts):
|
||||
amount = 0
|
||||
display_amount = 0
|
||||
srcContext = fullContext[0]
|
||||
try:
|
||||
itemContext = fullContext[1]
|
||||
@@ -68,7 +68,7 @@ class ContextMenu(object):
|
||||
# loop through registered menus
|
||||
m = menuHandler()
|
||||
if m.display(srcContext, selection):
|
||||
amount += 1
|
||||
display_amount += 1
|
||||
texts = m.getText(itemContext, selection)
|
||||
|
||||
if isinstance(texts, basestring):
|
||||
@@ -115,7 +115,7 @@ class ContextMenu(object):
|
||||
|
||||
empty = False
|
||||
|
||||
if amount > 0 and i != len(fullContexts) - 1:
|
||||
if display_amount > 0 and i != len(fullContexts) - 1:
|
||||
rootMenu.AppendSeparator()
|
||||
|
||||
debug_end = len(cls._ids)
|
||||
@@ -177,6 +177,28 @@ class ContextMenu(object):
|
||||
return None
|
||||
|
||||
|
||||
from gui.builtinContextMenus import ammoPattern, amount, cargo, changeAffectingSkills, damagePattern, droneRemoveStack, \
|
||||
droneSplit, factorReload, fighterAbilities, implantSets, itemRemove, itemStats, marketJump, metaSwap, moduleAmmoPicker, \
|
||||
moduleGlobalAmmoPicker, openFit, priceClear, project, shipJump, tacticalMode, targetResists, whProjector
|
||||
from gui.builtinContextMenus import ( # noqa: E402,F401
|
||||
ammoPattern,
|
||||
amount,
|
||||
cargo,
|
||||
changeAffectingSkills,
|
||||
damagePattern,
|
||||
droneRemoveStack,
|
||||
droneSplit,
|
||||
factorReload,
|
||||
fighterAbilities,
|
||||
implantSets,
|
||||
itemRemove,
|
||||
itemStats,
|
||||
marketJump,
|
||||
metaSwap,
|
||||
moduleAmmoPicker,
|
||||
moduleGlobalAmmoPicker,
|
||||
openFit,
|
||||
priceClear,
|
||||
project,
|
||||
shipJump,
|
||||
tacticalMode,
|
||||
targetResists,
|
||||
whProjector
|
||||
)
|
||||
|
||||
@@ -35,4 +35,4 @@ class Graph(object):
|
||||
return None
|
||||
|
||||
|
||||
from gui.builtinGraphs import fitDps
|
||||
from gui.builtinGraphs import fitDps # noqa: E402, F401
|
||||
|
||||
@@ -71,9 +71,6 @@ from service.port import Port
|
||||
from service.settings import HTMLExportSettings
|
||||
|
||||
from time import gmtime, strftime
|
||||
import logging
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
import threading
|
||||
import webbrowser
|
||||
@@ -91,7 +88,7 @@ if 'wxMac' not in wx.PlatformInfo or ('wxMac' in wx.PlatformInfo and wx.VERSION
|
||||
print("Error loading Attribute Editor: %s.\nAccess to Attribute Editor is disabled." % e.message)
|
||||
disableOverrideEditor = True
|
||||
|
||||
logger = logging.getLogger("pyfa.gui.mainFrame")
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
# dummy panel(no paint no erasebk)
|
||||
|
||||
@@ -21,7 +21,6 @@ import wx
|
||||
|
||||
import config
|
||||
from service.character import Character
|
||||
#import gui.graphFrame
|
||||
import gui.globalEvents as GE
|
||||
from gui.bitmapLoader import BitmapLoader
|
||||
|
||||
|
||||
@@ -37,5 +37,10 @@ class PreferenceView(object):
|
||||
return wx.NullBitmap
|
||||
|
||||
|
||||
from gui.builtinPreferenceViews import pyfaCrestPreferences, pyfaGeneralPreferences, \
|
||||
pyfaHTMLExportPreferences, pyfaNetworkPreferences, pyfaUpdatePreferences
|
||||
from gui.builtinPreferenceViews import (# noqa: E402, F401
|
||||
pyfaGeneralPreferences,
|
||||
pyfaNetworkPreferences,
|
||||
pyfaHTMLExportPreferences,
|
||||
pyfaCrestPreferences,
|
||||
pyfaUpdatePreferences
|
||||
)
|
||||
|
||||
@@ -42,5 +42,13 @@ class StatsView(object):
|
||||
raise NotImplementedError()
|
||||
|
||||
|
||||
from gui.builtinStatsViews import capacitorViewFull, firepowerViewFull, miningyieldViewFull, priceViewFull, rechargeViewFull, \
|
||||
resistancesViewFull, resourcesViewFull, targetingMiscViewFull
|
||||
from gui.builtinStatsViews import ( # noqa: E402, F401
|
||||
resourcesViewFull,
|
||||
resistancesViewFull,
|
||||
firepowerViewFull,
|
||||
miningyieldViewFull,
|
||||
capacitorViewFull,
|
||||
rechargeViewFull,
|
||||
targetingMiscViewFull,
|
||||
priceViewFull,
|
||||
)
|
||||
|
||||
@@ -65,5 +65,17 @@ class ViewColumn(object):
|
||||
raise NotImplementedError()
|
||||
|
||||
|
||||
from gui.builtinViewColumns import abilities, ammo, ammoIcon, attributeDisplay, baseIcon, baseName, capacitorUse, maxRange, \
|
||||
misc, price, propertyDisplay, state
|
||||
from gui.builtinViewColumns import ( # noqa: E402, F401
|
||||
abilities,
|
||||
ammo,
|
||||
ammoIcon,
|
||||
attributeDisplay,
|
||||
baseIcon,
|
||||
baseName,
|
||||
capacitorUse,
|
||||
maxRange,
|
||||
misc,
|
||||
price,
|
||||
propertyDisplay,
|
||||
state
|
||||
)
|
||||
|
||||
2
pyfa.py
2
pyfa.py
@@ -125,7 +125,7 @@ if __name__ == "__main__":
|
||||
import os.path
|
||||
|
||||
import eos.db
|
||||
import service.prefetch
|
||||
import service.prefetch # noqa: F401
|
||||
from gui.mainFrame import MainFrame
|
||||
|
||||
# Make sure the saveddata db exists
|
||||
|
||||
@@ -34,7 +34,6 @@ from eos.saveddata.module import Module as es_Module, State, Slot
|
||||
from eos.saveddata.fit import Fit as FitType
|
||||
from service.character import Character
|
||||
from service.damagePattern import DamagePattern
|
||||
from service.market import Market
|
||||
from service.settings import SettingsProvider
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
# along with pyfa. If not, see <http://www.gnu.org/licenses/>.
|
||||
# =============================================================================
|
||||
|
||||
import threading
|
||||
import os
|
||||
|
||||
import config
|
||||
@@ -25,7 +24,6 @@ from eos import db
|
||||
from eos.db import migration
|
||||
from eos.db.saveddata.loadDefaultDatabaseValues import DefaultDatabaseValues
|
||||
from eos.db.saveddata.databaseRepair import DatabaseCleanup
|
||||
from eos.saveddata.character import Character as es_Character
|
||||
|
||||
import logging
|
||||
|
||||
|
||||
@@ -22,11 +22,6 @@ try:
|
||||
except ImportError: # pragma: no cover
|
||||
import cPickle as pickle
|
||||
|
||||
try:
|
||||
from urllib.parse import quote
|
||||
except ImportError: # pragma: no cover
|
||||
from urllib import quote
|
||||
|
||||
logger = logging.getLogger("pycrest.eve")
|
||||
cache_re = re.compile(r'max-age=([0-9]+)')
|
||||
|
||||
|
||||
2
tox.ini
2
tox.ini
@@ -14,4 +14,4 @@ commands = py.test -vv --cov Pyfa tests/
|
||||
deps = flake8
|
||||
# TODO: Remove F class exceptions once all imports are fixed
|
||||
# TODO: Remove E731 and convert lambdas to defs
|
||||
commands = flake8 --exclude=.svn,CVS,.bzr,.hg,.git,__pycache__,venv,tests,.tox,build,dist,__init__.py --ignore=E126,E127,E128,E731,F401,F403,F405 service gui eos utils config.py pyfa.py --max-line-length=165
|
||||
commands = flake8 --exclude=.svn,CVS,.bzr,.hg,.git,__pycache__,venv,tests,.tox,build,dist,__init__.py --ignore=E126,E127,E128,E731 service gui eos utils config.py pyfa.py --max-line-length=165
|
||||
|
||||
Reference in New Issue
Block a user