flake8 fixes
This commit is contained in:
@@ -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(Effect, effects_table,
|
||||
})
|
||||
|
||||
mapper(ItemEffect, typeeffects_table)
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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;")
|
||||
|
||||
|
||||
@@ -250,9 +250,9 @@ mapper(es_Fit, fits_table,
|
||||
)
|
||||
|
||||
mapper(ProjectedFit, projectedFits_table,
|
||||
properties={
|
||||
"_ProjectedFit__amount": projectedFits_table.c.amount,
|
||||
}
|
||||
properties={
|
||||
"_ProjectedFit__amount": projectedFits_table.c.amount,
|
||||
}
|
||||
)
|
||||
|
||||
mapper(CommandFit, commandFits_table)
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
# along with eos. If not, see <http://www.gnu.org/licenses/>.
|
||||
# ===============================================================================
|
||||
|
||||
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 @@ modules_table = Table("modules", saveddata_meta,
|
||||
|
||||
mapper(Module, modules_table,
|
||||
properties={"owner": relation(Fit)})
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -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"))
|
||||
|
||||
@@ -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"))
|
||||
|
||||
@@ -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"))
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
listen(Booster, 'load', apply_col_listeners)
|
||||
|
||||
@@ -359,7 +359,7 @@ class Skill(HandledItem):
|
||||
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))
|
||||
|
||||
|
||||
@@ -186,7 +186,7 @@ class Fit(object):
|
||||
@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)
|
||||
|
||||
Reference in New Issue
Block a user