From 3de63c5ca5a24917f7bc9fac2b18cd0612f2d5fc Mon Sep 17 00:00:00 2001 From: blitzmann Date: Mon, 8 May 2017 21:27:25 -0400 Subject: [PATCH] flake8 fixes --- eos/db/gamedata/effect.py | 4 +--- eos/db/gamedata/queries.py | 2 ++ eos/db/migrations/upgrade23.py | 1 - eos/db/saveddata/fit.py | 6 +++--- eos/db/saveddata/module.py | 5 +---- eos/effects/concordsecstatustankbonus.py | 2 ++ eos/effects/elitebonuscoveropswarpvelocity1.py | 2 ++ eos/effects/elitebonusreconwarpvelocity3.py | 2 ++ eos/effects/elitereconstasiswebbonus1.py | 2 ++ .../shipbonusdreadnoughta1energywarfareamountbonus.py | 8 ++++++-- eos/effects/shipbonusdreadnoughtm1webrangebonus.py | 5 ++++- .../shipbonusforceauxiliarya1nosferatudrainamount.py | 5 ++++- .../shipbonusforceauxiliarya1nosferaturangebonus.py | 8 ++++++-- .../shipbonusforceauxiliarym1remotearmorrepairduration.py | 5 ++++- eos/effects/shipbonusmedmissileflighttimecc2.py | 8 ++++++-- eos/effects/shipbonusrole3capitalenergydamagebonus.py | 2 ++ eos/effects/shipbonusrole4nosferatucpubonus.py | 2 ++ ...hipbonusrole5capitalremotearmorrepairpowergridbonus.py | 2 ++ eos/effects/shipbonussmallmissileflighttimecf1.py | 8 ++++++-- eos/effects/shipbonussptrofmf.py | 5 ++++- eos/effects/shipbonustitana1energywarfareamountbonus.py | 8 ++++++-- eos/effects/shipbonustitanm1webrangebonus.py | 5 ++++- eos/effects/shipmoduletrackingdisruptor.py | 8 ++++---- eos/events.py | 3 ++- eos/saveddata/character.py | 2 +- eos/saveddata/fit.py | 2 +- gui/itemStats.py | 2 +- gui/mainFrame.py | 1 - gui/shipBrowser.py | 6 +++--- pyfa.py | 2 +- service/character.py | 2 +- tox.ini | 2 +- 32 files changed, 86 insertions(+), 41 deletions(-) diff --git a/eos/db/gamedata/effect.py b/eos/db/gamedata/effect.py index 5ea5bb4575..012efe9661 100644 --- a/eos/db/gamedata/effect.py +++ b/eos/db/gamedata/effect.py @@ -18,8 +18,7 @@ # =============================================================================== from sqlalchemy import Column, String, Integer, Boolean, Table, ForeignKey -from sqlalchemy.ext.associationproxy import association_proxy -from sqlalchemy.orm import mapper, synonym, relation, deferred +from sqlalchemy.orm import mapper, synonym, deferred from eos.db import gamedata_meta from eos.gamedata import Effect, ItemEffect @@ -45,4 +44,3 @@ }) mapper(ItemEffect, typeeffects_table) - diff --git a/eos/db/gamedata/queries.py b/eos/db/gamedata/queries.py index 7ea1b1f7c1..fa8d987236 100644 --- a/eos/db/gamedata/queries.py +++ b/eos/db/gamedata/queries.py @@ -125,6 +125,7 @@ def getItems(lookfor, eager=None): results.sort(key=lambda x: lookfor.index(x.ID)) return results + @cachedQuery(1, "lookfor") def getAlphaClone(lookfor, eager=None): if isinstance(lookfor, int): @@ -359,6 +360,7 @@ def directAttributeRequest(itemIDs, attrIDs): result = gamedata_session.execute(q).fetchall() return result + def getRequiredFor(itemID, attrMapping): Attribute1 = aliased(Attribute) Attribute2 = aliased(Attribute) diff --git a/eos/db/migrations/upgrade23.py b/eos/db/migrations/upgrade23.py index 809262d4d1..d609e995ce 100644 --- a/eos/db/migrations/upgrade23.py +++ b/eos/db/migrations/upgrade23.py @@ -11,4 +11,3 @@ def upgrade(saveddata_engine): saveddata_engine.execute("SELECT secStatus FROM characters LIMIT 1") except sqlalchemy.exc.DatabaseError: saveddata_engine.execute("ALTER TABLE characters ADD COLUMN secStatus FLOAT;") - diff --git a/eos/db/saveddata/fit.py b/eos/db/saveddata/fit.py index 7f8fdbe616..07375dcafb 100644 --- a/eos/db/saveddata/fit.py +++ b/eos/db/saveddata/fit.py @@ -250,9 +250,9 @@ def __repr__(self): ) mapper(ProjectedFit, projectedFits_table, - properties={ - "_ProjectedFit__amount": projectedFits_table.c.amount, - } + properties={ + "_ProjectedFit__amount": projectedFits_table.c.amount, + } ) mapper(CommandFit, commandFits_table) diff --git a/eos/db/saveddata/module.py b/eos/db/saveddata/module.py index 704eca99d4..149f4f73cc 100644 --- a/eos/db/saveddata/module.py +++ b/eos/db/saveddata/module.py @@ -17,7 +17,7 @@ # along with eos. If not, see . # =============================================================================== -from sqlalchemy import Table, Column, Integer, ForeignKey, CheckConstraint, Boolean, DateTime, select +from sqlalchemy import Table, Column, Integer, ForeignKey, CheckConstraint, Boolean, DateTime from sqlalchemy.orm import relation, mapper import datetime @@ -40,6 +40,3 @@ mapper(Module, modules_table, properties={"owner": relation(Fit)}) - - - diff --git a/eos/effects/concordsecstatustankbonus.py b/eos/effects/concordsecstatustankbonus.py index aee24cf95e..853e677156 100644 --- a/eos/effects/concordsecstatustankbonus.py +++ b/eos/effects/concordsecstatustankbonus.py @@ -1,4 +1,6 @@ type = "passive" + + def handler(fit, src, context): # Get pilot sec status bonus directly here, instead of going through the intermediary effects diff --git a/eos/effects/elitebonuscoveropswarpvelocity1.py b/eos/effects/elitebonuscoveropswarpvelocity1.py index 6a661ae0f6..77c3b560e6 100644 --- a/eos/effects/elitebonuscoveropswarpvelocity1.py +++ b/eos/effects/elitebonuscoveropswarpvelocity1.py @@ -3,5 +3,7 @@ # Used by: # Ship: Pacifier type = "passive" + + def handler(fit, src, context): fit.ship.boostItemAttr("warpSpeedMultiplier", src.getModifiedItemAttr("eliteBonusCoverOps1"), skill="Covert Ops") diff --git a/eos/effects/elitebonusreconwarpvelocity3.py b/eos/effects/elitebonusreconwarpvelocity3.py index 9d7f98dfcc..909c577a1d 100644 --- a/eos/effects/elitebonusreconwarpvelocity3.py +++ b/eos/effects/elitebonusreconwarpvelocity3.py @@ -3,5 +3,7 @@ # Used by: # Ship: Enforcer type = "passive" + + def handler(fit, src, context): fit.ship.boostItemAttr("warpSpeedMultiplier", src.getModifiedItemAttr("eliteBonusReconShip3"), skill="Recon Ships") diff --git a/eos/effects/elitereconstasiswebbonus1.py b/eos/effects/elitereconstasiswebbonus1.py index 0a05274f4a..abbf4f6c63 100644 --- a/eos/effects/elitereconstasiswebbonus1.py +++ b/eos/effects/elitereconstasiswebbonus1.py @@ -3,5 +3,7 @@ # Used by: # Ship: Enforcer type = "passive" + + def handler(fit, src, context): fit.modules.filteredItemBoost(lambda mod: mod.item.group.name == "Stasis Web", "maxRange", src.getModifiedItemAttr("eliteBonusReconShip1"), skill="Recon Ships") diff --git a/eos/effects/shipbonusdreadnoughta1energywarfareamountbonus.py b/eos/effects/shipbonusdreadnoughta1energywarfareamountbonus.py index 527eba0c29..86e7725ac9 100644 --- a/eos/effects/shipbonusdreadnoughta1energywarfareamountbonus.py +++ b/eos/effects/shipbonusdreadnoughta1energywarfareamountbonus.py @@ -3,6 +3,10 @@ # Used by: # Ship: Chemosh type = "passive" + + def handler(fit, src, context): - fit.modules.filteredItemBoost(lambda mod: mod.item.group.name == "Energy Nosferatu", "powerTransferAmount", src.getModifiedItemAttr("shipBonusDreadnoughtA1"), skill="Amarr Dreadnought") - fit.modules.filteredItemBoost(lambda mod: mod.item.group.name == "Energy Neutralizer", "energyNeutralizerAmount", src.getModifiedItemAttr("shipBonusDreadnoughtA1"), skill="Amarr Dreadnought") + fit.modules.filteredItemBoost(lambda mod: mod.item.group.name == "Energy Nosferatu", + "powerTransferAmount", src.getModifiedItemAttr("shipBonusDreadnoughtA1"), skill="Amarr Dreadnought") + fit.modules.filteredItemBoost(lambda mod: mod.item.group.name == "Energy Neutralizer", + "energyNeutralizerAmount", src.getModifiedItemAttr("shipBonusDreadnoughtA1"), skill="Amarr Dreadnought") diff --git a/eos/effects/shipbonusdreadnoughtm1webrangebonus.py b/eos/effects/shipbonusdreadnoughtm1webrangebonus.py index d258b3efc1..f79762142b 100644 --- a/eos/effects/shipbonusdreadnoughtm1webrangebonus.py +++ b/eos/effects/shipbonusdreadnoughtm1webrangebonus.py @@ -3,5 +3,8 @@ # Used by: # Ship: Chemosh type = "passive" + + def handler(fit, src, context): - fit.modules.filteredItemBoost(lambda mod: mod.item.group.name == "Stasis Web", "maxRange", src.getModifiedItemAttr("shipBonusDreadnoughtM1"), skill="Minmatar Dreadnought") + fit.modules.filteredItemBoost(lambda mod: mod.item.group.name == "Stasis Web", + "maxRange", src.getModifiedItemAttr("shipBonusDreadnoughtM1"), skill="Minmatar Dreadnought") diff --git a/eos/effects/shipbonusforceauxiliarya1nosferatudrainamount.py b/eos/effects/shipbonusforceauxiliarya1nosferatudrainamount.py index 9544149f1e..113c0e899e 100644 --- a/eos/effects/shipbonusforceauxiliarya1nosferatudrainamount.py +++ b/eos/effects/shipbonusforceauxiliarya1nosferatudrainamount.py @@ -3,5 +3,8 @@ # Used by: # Ship: Dagon type = "passive" + + def handler(fit, src, context): - fit.modules.filteredItemBoost(lambda mod: mod.item.group.name == "Energy Nosferatu", "powerTransferAmount", src.getModifiedItemAttr("shipBonusForceAuxiliaryA1"), skill="Amarr Carrier") + fit.modules.filteredItemBoost(lambda mod: mod.item.group.name == "Energy Nosferatu", + "powerTransferAmount", src.getModifiedItemAttr("shipBonusForceAuxiliaryA1"), skill="Amarr Carrier") diff --git a/eos/effects/shipbonusforceauxiliarya1nosferaturangebonus.py b/eos/effects/shipbonusforceauxiliarya1nosferaturangebonus.py index aabd0b7fb9..f3a1d2a628 100644 --- a/eos/effects/shipbonusforceauxiliarya1nosferaturangebonus.py +++ b/eos/effects/shipbonusforceauxiliarya1nosferaturangebonus.py @@ -3,6 +3,10 @@ # Used by: # Ship: Dagon type = "passive" + + def handler(fit, src, context): - fit.modules.filteredItemBoost(lambda mod: mod.item.group.name == "Energy Nosferatu", "maxRange", src.getModifiedItemAttr("shipBonusForceAuxiliaryA1"), skill="Amarr Carrier") - fit.modules.filteredItemBoost(lambda mod: mod.item.group.name == "Energy Nosferatu", "falloffEffectiveness", src.getModifiedItemAttr("shipBonusForceAuxiliaryA1"), skill="Amarr Carrier") + fit.modules.filteredItemBoost(lambda mod: mod.item.group.name == "Energy Nosferatu", + "maxRange", src.getModifiedItemAttr("shipBonusForceAuxiliaryA1"), skill="Amarr Carrier") + fit.modules.filteredItemBoost(lambda mod: mod.item.group.name == "Energy Nosferatu", + "falloffEffectiveness", src.getModifiedItemAttr("shipBonusForceAuxiliaryA1"), skill="Amarr Carrier") diff --git a/eos/effects/shipbonusforceauxiliarym1remotearmorrepairduration.py b/eos/effects/shipbonusforceauxiliarym1remotearmorrepairduration.py index cec5a745ec..fd4dca81af 100644 --- a/eos/effects/shipbonusforceauxiliarym1remotearmorrepairduration.py +++ b/eos/effects/shipbonusforceauxiliarym1remotearmorrepairduration.py @@ -3,5 +3,8 @@ # Used by: # Ship: Dagon type = "passive" + + def handler(fit, src, context): - fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Remote Armor Repair Systems"), "duration", src.getModifiedItemAttr("shipBonusForceAuxiliaryM1"), skill="Minmatar Carrier") + fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Remote Armor Repair Systems"), + "duration", src.getModifiedItemAttr("shipBonusForceAuxiliaryM1"), skill="Minmatar Carrier") diff --git a/eos/effects/shipbonusmedmissileflighttimecc2.py b/eos/effects/shipbonusmedmissileflighttimecc2.py index 7bf6a461f6..a8d76a49e5 100644 --- a/eos/effects/shipbonusmedmissileflighttimecc2.py +++ b/eos/effects/shipbonusmedmissileflighttimecc2.py @@ -3,6 +3,10 @@ # Used by: # Ship: Enforcer type = "passive" + + def handler(fit, src, context): - fit.modules.filteredChargeBoost(lambda mod: mod.charge.requiresSkill("Heavy Missiles"), "explosionDelay", src.getModifiedItemAttr("shipBonusCC2"), skill="Caldari Cruiser") - fit.modules.filteredChargeBoost(lambda mod: mod.charge.requiresSkill("Heavy Assault Missiles"), "explosionDelay", src.getModifiedItemAttr("shipBonusCC2"), skill="Caldari Cruiser") + fit.modules.filteredChargeBoost(lambda mod: mod.charge.requiresSkill("Heavy Missiles"), + "explosionDelay", src.getModifiedItemAttr("shipBonusCC2"), skill="Caldari Cruiser") + fit.modules.filteredChargeBoost(lambda mod: mod.charge.requiresSkill("Heavy Assault Missiles"), + "explosionDelay", src.getModifiedItemAttr("shipBonusCC2"), skill="Caldari Cruiser") diff --git a/eos/effects/shipbonusrole3capitalenergydamagebonus.py b/eos/effects/shipbonusrole3capitalenergydamagebonus.py index 2baf7a3cf4..d21771a039 100644 --- a/eos/effects/shipbonusrole3capitalenergydamagebonus.py +++ b/eos/effects/shipbonusrole3capitalenergydamagebonus.py @@ -4,5 +4,7 @@ # Ship: Chemosh # Ship: Molok type = "passive" + + def handler(fit, src, context): fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Capital Energy Turret"), "damageMultiplier", src.getModifiedItemAttr("shipBonusRole3")) diff --git a/eos/effects/shipbonusrole4nosferatucpubonus.py b/eos/effects/shipbonusrole4nosferatucpubonus.py index 1d4de3a3bb..1d67fbb4ba 100644 --- a/eos/effects/shipbonusrole4nosferatucpubonus.py +++ b/eos/effects/shipbonusrole4nosferatucpubonus.py @@ -4,5 +4,7 @@ # Ship: Dagon # Ship: Rabisu type = "passive" + + def handler(fit, src, context): fit.modules.filteredItemBoost(lambda mod: mod.item.group.name == "Energy Nosferatu", "cpu", src.getModifiedItemAttr("shipBonusRole4")) diff --git a/eos/effects/shipbonusrole5capitalremotearmorrepairpowergridbonus.py b/eos/effects/shipbonusrole5capitalremotearmorrepairpowergridbonus.py index 89c87168b5..8e33eb7a03 100644 --- a/eos/effects/shipbonusrole5capitalremotearmorrepairpowergridbonus.py +++ b/eos/effects/shipbonusrole5capitalremotearmorrepairpowergridbonus.py @@ -3,5 +3,7 @@ # Used by: # Ship: Dagon type = "passive" + + def handler(fit, src, context): fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Capital Remote Armor Repair Systems"), "power", src.getModifiedItemAttr("shipBonusRole5")) diff --git a/eos/effects/shipbonussmallmissileflighttimecf1.py b/eos/effects/shipbonussmallmissileflighttimecf1.py index 2f755750c6..0b41b41856 100644 --- a/eos/effects/shipbonussmallmissileflighttimecf1.py +++ b/eos/effects/shipbonussmallmissileflighttimecf1.py @@ -3,6 +3,10 @@ # Used by: # Ship: Pacifier type = "passive" + + def handler(fit, src, context): - fit.modules.filteredChargeBoost(lambda mod: mod.charge.requiresSkill("Rockets"), "explosionDelay", src.getModifiedItemAttr("shipBonusCF"), skill="Caldari Frigate") - fit.modules.filteredChargeBoost(lambda mod: mod.charge.requiresSkill("Light Missiles"), "explosionDelay", src.getModifiedItemAttr("shipBonusCF"), skill="Caldari Frigate") + fit.modules.filteredChargeBoost(lambda mod: mod.charge.requiresSkill("Rockets"), + "explosionDelay", src.getModifiedItemAttr("shipBonusCF"), skill="Caldari Frigate") + fit.modules.filteredChargeBoost(lambda mod: mod.charge.requiresSkill("Light Missiles"), + "explosionDelay", src.getModifiedItemAttr("shipBonusCF"), skill="Caldari Frigate") diff --git a/eos/effects/shipbonussptrofmf.py b/eos/effects/shipbonussptrofmf.py index 6b226c3bf9..86ac5f332b 100644 --- a/eos/effects/shipbonussptrofmf.py +++ b/eos/effects/shipbonussptrofmf.py @@ -3,5 +3,8 @@ # Used by: # Ship: Pacifier type = "passive" + + def handler(fit, src, context): - fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Small Projectile Turret"), "speed", src.getModifiedItemAttr("shipBonusMF"), skill="Minmatar Frigate") + fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Small Projectile Turret"), + "speed", src.getModifiedItemAttr("shipBonusMF"), skill="Minmatar Frigate") diff --git a/eos/effects/shipbonustitana1energywarfareamountbonus.py b/eos/effects/shipbonustitana1energywarfareamountbonus.py index c61632b449..5964398140 100644 --- a/eos/effects/shipbonustitana1energywarfareamountbonus.py +++ b/eos/effects/shipbonustitana1energywarfareamountbonus.py @@ -3,6 +3,10 @@ # Used by: # Ship: Molok type = "passive" + + def handler(fit, src, context): - fit.modules.filteredItemBoost(lambda mod: mod.item.group.name == "Energy Nosferatu", "powerTransferAmount", src.getModifiedItemAttr("shipBonusTitanA1"), skill="Amarr Titan") - fit.modules.filteredItemBoost(lambda mod: mod.item.group.name == "Energy Neutralizer", "energyNeutralizerAmount", src.getModifiedItemAttr("shipBonusTitanA1"), skill="Amarr Titan") + fit.modules.filteredItemBoost(lambda mod: mod.item.group.name == "Energy Nosferatu", + "powerTransferAmount", src.getModifiedItemAttr("shipBonusTitanA1"), skill="Amarr Titan") + fit.modules.filteredItemBoost(lambda mod: mod.item.group.name == "Energy Neutralizer", + "energyNeutralizerAmount", src.getModifiedItemAttr("shipBonusTitanA1"), skill="Amarr Titan") diff --git a/eos/effects/shipbonustitanm1webrangebonus.py b/eos/effects/shipbonustitanm1webrangebonus.py index 0fd26a1b73..c026e376ed 100644 --- a/eos/effects/shipbonustitanm1webrangebonus.py +++ b/eos/effects/shipbonustitanm1webrangebonus.py @@ -3,5 +3,8 @@ # Used by: # Ship: Molok type = "passive" + + def handler(fit, src, context): - fit.modules.filteredItemBoost(lambda mod: mod.item.group.name == "Stasis Web", "maxRange", src.getModifiedItemAttr("shipBonusTitanM1"), skill="Minmatar Titan") + fit.modules.filteredItemBoost(lambda mod: mod.item.group.name == "Stasis Web", + "maxRange", src.getModifiedItemAttr("shipBonusTitanM1"), skill="Minmatar Titan") diff --git a/eos/effects/shipmoduletrackingdisruptor.py b/eos/effects/shipmoduletrackingdisruptor.py index 1ddd85f94d..2c04a4a6e1 100644 --- a/eos/effects/shipmoduletrackingdisruptor.py +++ b/eos/effects/shipmoduletrackingdisruptor.py @@ -5,14 +5,14 @@ type = "projected", "active" -def handler(fit, module, context, *args, **kwargs): +def handler(fit, module, context, *args, **kwargs): if "projected" in context: fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Gunnery"), "trackingSpeed", module.getModifiedItemAttr("trackingSpeedBonus"), - stackingPenalties=True, *args, **kwargs) + stackingPenalties=True, *args, **kwargs) fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Gunnery"), "maxRange", module.getModifiedItemAttr("maxRangeBonus"), - stackingPenalties=True, *args, **kwargs) + stackingPenalties=True, *args, **kwargs) fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Gunnery"), "falloff", module.getModifiedItemAttr("falloffBonus"), - stackingPenalties=True, *args, **kwargs) + stackingPenalties=True, *args, **kwargs) diff --git a/eos/events.py b/eos/events.py index dd7a88a2b4..de8bdfadbb 100644 --- a/eos/events.py +++ b/eos/events.py @@ -77,10 +77,11 @@ def apply_rel_listeners(target, context): listen(rel, 'append', rel_listener) listen(rel, 'remove', rel_listener) + listen(Fit, 'load', apply_rel_listeners) listen(Module, 'load', apply_col_listeners) listen(Drone, 'load', apply_col_listeners) listen(Fighter, 'load', apply_col_listeners) listen(Cargo, 'load', apply_col_listeners) listen(Implant, 'load', apply_col_listeners) -listen(Booster, 'load', apply_col_listeners) \ No newline at end of file +listen(Booster, 'load', apply_col_listeners) diff --git a/eos/saveddata/character.py b/eos/saveddata/character.py index ca789208ac..1c0c7cecf8 100644 --- a/eos/saveddata/character.py +++ b/eos/saveddata/character.py @@ -359,7 +359,7 @@ def setLevel(self, level, persist=False): if item.group.category.ID == 16: # Skill category if level < rlevel: skill = self.character.getSkill(item.ID) - #print "Removing skill: {}, Dependant level: {}, Required level: {}".format(skill, level, rlevel) + # print "Removing skill: {}, Dependant level: {}, Required level: {}".format(skill, level, rlevel) skill.setLevel(None, persist) pyfalog.debug("Strict Skill levels enabled, time to process {}: {}".format(self.item.ID, time.time() - start)) diff --git a/eos/saveddata/fit.py b/eos/saveddata/fit.py index a0981d85b1..c59ab4c7d1 100644 --- a/eos/saveddata/fit.py +++ b/eos/saveddata/fit.py @@ -186,7 +186,7 @@ def mode(self, mode): @property def modifiedCoalesce(self): """ - This is a property that should get whichever date is available for the fit. @todo: migrate old timestamp data + This is a property that should get whichever date is available for the fit. @todo: migrate old timestamp data and ensure created / modified are set in database to get rid of this """ return self.modified or self.created or datetime.datetime.fromtimestamp(self.timestamp) diff --git a/gui/itemStats.py b/gui/itemStats.py index 2596413d91..8488a57522 100644 --- a/gui/itemStats.py +++ b/gui/itemStats.py @@ -812,7 +812,7 @@ def getFullSkillTree(self, parentSkill, parent, sbIconId): else: itemIcon = -1 - grand = self.reqTree.AppendItem(child, "{}".format(item.name), itemIcon) + self.reqTree.AppendItem(child, "{}".format(item.name), itemIcon) class ItemEffects(wx.Panel): diff --git a/gui/mainFrame.py b/gui/mainFrame.py index 77d0c97444..f81780b44f 100644 --- a/gui/mainFrame.py +++ b/gui/mainFrame.py @@ -20,7 +20,6 @@ import sys import os.path from logbook import Logger -import datetime import sqlalchemy # noinspection PyPackageRequirements diff --git a/gui/shipBrowser.py b/gui/shipBrowser.py index 2a769ad318..5902b53e66 100644 --- a/gui/shipBrowser.py +++ b/gui/shipBrowser.py @@ -424,7 +424,7 @@ def OnBrowserSearchBoxEsc(self, event): def OnResize(self, event): self.Refresh() - def ToggleRecentShips(self, bool = None, emitEvent = True): + def ToggleRecentShips(self, bool=None, emitEvent=True): # this is so janky. Need to revaluate pretty much entire ship browser. >.< toggle = bool if bool is not None else not self.shipBrowser.recentFits @@ -958,7 +958,7 @@ def searchStage(self, event): def importStage(self, event): """ - The import stage handles both displaying fits after importing as well as displaying recent fits. todo: need to + The import stage handles both displaying fits after importing as well as displaying recent fits. todo: need to reconcile these two better into a more uniform function, right now hacked together to get working """ self.lpane.ShowLoading(False) @@ -1946,7 +1946,7 @@ def DrawItem(self, mdc): mdc.SetFont(self.fontNormal) fitDate = self.timestamp.strftime("%m/%d/%Y %H:%M") - fitLocalDate = fitDate #"%d/%02d/%02d %02d:%02d" % (fitDate[0], fitDate[1], fitDate[2], fitDate[3], fitDate[4]) + fitLocalDate = fitDate # "%d/%02d/%02d %02d:%02d" % (fitDate[0], fitDate[1], fitDate[2], fitDate[3], fitDate[4]) pfdate = drawUtils.GetPartialText(mdc, fitLocalDate, self.toolbarx - self.textStartx - self.padding * 2 - self.thoverw) diff --git a/pyfa.py b/pyfa.py index 3b7426b5d5..b37ae2ccce 100755 --- a/pyfa.py +++ b/pyfa.py @@ -24,7 +24,6 @@ import re import sys import traceback -from imp import find_module from optparse import AmbiguousOptionError, BadOptionError, OptionParser from logbook import CRITICAL, DEBUG, ERROR, FingersCrossedHandler, INFO, Logger, NestedSetup, NullHandler, StreamHandler, TimedRotatingFileHandler, WARNING, \ @@ -359,6 +358,7 @@ def handleGUIException(exc_type, exc_value, exc_traceback): if 'wxMac' not in wx.PlatformInfo or ('wxMac' in wx.PlatformInfo and wx.VERSION >= (3, 0)): try: import requests + config.requestsVersion = requests.__version except ImportError: raise PreCheckException("Cannot import requests. You can download requests from https://pypi.python.org/pypi/requests.") diff --git a/service/character.py b/service/character.py index ab8736c35f..0ae8158cb3 100644 --- a/service/character.py +++ b/service/character.py @@ -158,7 +158,7 @@ def exportText(self): data += u"Skills required for {}:\n".format(item) data += u"{}{}: {}\n".format(" " * s["indent"], s["skill"], int(s["level"])) data += u"-" * 79 + "\n" - except Exception, e: + except Exception: pass return data diff --git a/tox.ini b/tox.ini index 7fad13a2b4..2d1072d505 100644 --- a/tox.ini +++ b/tox.ini @@ -13,4 +13,4 @@ commands = py.test -vv --cov Pyfa tests/ [testenv:pep8] deps = flake8 # 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=E121,E126,E127,E128,E203,E731 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,floatspin.py --ignore=E121,E126,E127,E128,E203,E731 service gui eos utils config.py pyfa.py --max-line-length=165