Skip to content

Commit

Permalink
Tox fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Ebag333 committed Feb 5, 2017
1 parent 603a8ac commit be66ff1
Show file tree
Hide file tree
Showing 35 changed files with 75 additions and 63 deletions.
22 changes: 13 additions & 9 deletions eos/db/gamedata/alphaClones.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,20 @@
from eos.db import gamedata_meta
from eos.types import AlphaClone, AlphaCloneSkill

alphaclones_table = Table("alphaClones", gamedata_meta,
Column("alphaCloneID", Integer, primary_key=True),
Column("alphaCloneName", String),
)
alphaclones_table = Table(
"alphaClones",
gamedata_meta,
Column("alphaCloneID", Integer, primary_key=True),
Column("alphaCloneName", String),
)

alphacloneskskills_table = Table("alphaCloneSkills", gamedata_meta,
Column("alphaCloneID", Integer, ForeignKey("alphaClones.alphaCloneID"), primary_key=True),
Column("typeID", Integer, primary_key=True),
Column("level", Integer),
)
alphacloneskskills_table = Table(
"alphaCloneSkills",
gamedata_meta,
Column("alphaCloneID", Integer, ForeignKey("alphaClones.alphaCloneID"), primary_key=True),
Column("typeID", Integer, primary_key=True),
Column("level", Integer),
)

mapper(AlphaClone, alphaclones_table,
properties={
Expand Down
2 changes: 1 addition & 1 deletion eos/db/saveddata/databaseRepair.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def ExecuteSQLQuery(saveddata_engine, query):
results = saveddata_engine.execute(query)
return results
except sqlalchemy.exc.DatabaseError:
logger.error("Failed to connect to database or error executing query:\n%s",query)
logger.error("Failed to connect to database or error executing query:\n%s", query)
return None

@staticmethod
Expand Down
3 changes: 0 additions & 3 deletions eos/db/saveddata/queries.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,8 @@
from eos.db import saveddata_session, sd_lock
from eos.db.saveddata.fit import projectedFits_table
from eos.db.util import processEager, processWhere
from eos.db import saveddata_session, sd_lock

from eos.types import *
from eos.db.saveddata.fit import projectedFits_table
from sqlalchemy.sql import and_
import eos.config

configVal = getattr(eos.config, "saveddataCache", None)
Expand Down
3 changes: 2 additions & 1 deletion eos/effects/chargebonuswarfarecharge.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
# Items from market group: Ammunition & Charges > Command Burst Charges (15 of 15)
type = "active"


def handler(fit, module, context):
for x in xrange(1, 4):
value = module.getModifiedChargeAttr("warfareBuff{}Multiplier".format(x))
module.multiplyItemAttr("warfareBuff{}Value".format(x), value)
module.multiplyItemAttr("warfareBuff{}Value".format(x), value)
2 changes: 2 additions & 0 deletions eos/effects/elitebonuscommandshipinformationhiddencs3.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Not used by any item
type = "passive"


def handler(fit, module, context):
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Information Command Specialist"),
"commandBonusHidden", module.getModifiedItemAttr("eliteBonusCommandShips3"), skill="Command Ships")
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
# Used by:
# Ship: Rabisu
type = "passive"


def handler(fit, src, context):
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Remote Armor Repair Systems"), "falloffEffectiveness", src.getModifiedItemAttr("eliteBonusLogistics1"), skill="Logistics Cruisers")
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Remote Armor Repair Systems"), "maxRange", src.getModifiedItemAttr("eliteBonusLogistics1"), skill="Logistics Cruisers")
3 changes: 1 addition & 2 deletions eos/effects/energydestabilizationnew.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@


def handler(fit, src, context):
if "projected" in context and (
(hasattr(src, "state") and src.state >= State.ACTIVE) or hasattr(src, "amountActive")):
if "projected" in context and ((hasattr(src, "state") and src.state >= State.ACTIVE) or hasattr(src, "amountActive")):
multiplier = src.amountActive if hasattr(src, "amountActive") else 1
amount = src.getModifiedItemAttr("energyNeutralizerAmount")
time = src.getModifiedItemAttr("duration")
Expand Down
2 changes: 2 additions & 0 deletions eos/effects/iceharvestingdroneoperationdurationbonus.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
# Modules named like: Drone Mining Augmentor (8 of 8)
# Skill: Ice Harvesting Drone Operation
type = "passive"


def handler(fit, src, context):
lvl = src.level if "skill" in context else 1
fit.drones.filteredItemBoost(lambda mod: mod.item.requiresSkill("Ice Harvesting Drone Operation"), "duration", src.getModifiedItemAttr("rofBonus") * lvl)
4 changes: 3 additions & 1 deletion eos/effects/miningforemanstrengthbonus.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
# Used by:
# Skill: Mining Director
type = "passive"


def handler(fit, src, context):
lvl = src.level
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Mining Foreman"), "warfareBuff4Value", src.getModifiedItemAttr("commandStrengthBonus") * lvl)
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Mining Foreman"), "warfareBuff3Value", src.getModifiedItemAttr("commandStrengthBonus") * lvl)
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Mining Foreman"), "warfareBuff2Value", src.getModifiedItemAttr("commandStrengthBonus") * lvl)
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Mining Foreman"), "warfareBuff1Value", src.getModifiedItemAttr("commandStrengthBonus") * lvl)
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Mining Foreman"), "warfareBuff1Value", src.getModifiedItemAttr("commandStrengthBonus") * lvl)
4 changes: 2 additions & 2 deletions eos/effects/modulebonuswarfarelinkarmor.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
'''

type = "active", "gang"


def handler(fit, module, context, **kwargs):
for x in xrange(1, 5):
if module.getModifiedChargeAttr("warfareBuff{}ID".format(x)):
Expand All @@ -21,5 +23,3 @@ def handler(fit, module, context, **kwargs):

if id:
fit.addCommandBonus(id, value, module, kwargs['effect'])


4 changes: 3 additions & 1 deletion eos/effects/modulebonuswarfarelinkinfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@
# Variations of module: Information Command Burst I (2 of 2)

type = "active", "gang"


def handler(fit, module, context, **kwargs):
for x in xrange(1, 5):
if module.getModifiedChargeAttr("warfareBuff{}ID".format(x)):
value = module.getModifiedItemAttr("warfareBuff{}Value".format(x))
id = module.getModifiedChargeAttr("warfareBuff{}ID".format(x))

if id:
fit.addCommandBonus(id, value, module, kwargs['effect'])
fit.addCommandBonus(id, value, module, kwargs['effect'])
4 changes: 3 additions & 1 deletion eos/effects/modulebonuswarfarelinkmining.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@
# Variations of module: Mining Foreman Burst I (2 of 2)

type = "active", "gang"


def handler(fit, module, context, **kwargs):
for x in xrange(1, 5):
if module.getModifiedChargeAttr("warfareBuff{}ID".format(x)):
value = module.getModifiedItemAttr("warfareBuff{}Value".format(x))
id = module.getModifiedChargeAttr("warfareBuff{}ID".format(x))

if id:
fit.addCommandBonus(id, value, module, kwargs['effect'])
fit.addCommandBonus(id, value, module, kwargs['effect'])
4 changes: 3 additions & 1 deletion eos/effects/modulebonuswarfarelinkshield.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@
# Variations of module: Shield Command Burst I (2 of 2)

type = "active", "gang"


def handler(fit, module, context, **kwargs):
for x in xrange(1, 5):
if module.getModifiedChargeAttr("warfareBuff{}ID".format(x)):
value = module.getModifiedItemAttr("warfareBuff{}Value".format(x))
id = module.getModifiedChargeAttr("warfareBuff{}ID".format(x))

if id:
fit.addCommandBonus(id, value, module, kwargs['effect'])
fit.addCommandBonus(id, value, module, kwargs['effect'])
4 changes: 3 additions & 1 deletion eos/effects/modulebonuswarfarelinkskirmish.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@
# Variations of module: Skirmish Command Burst I (2 of 2)

type = "active", "gang"


def handler(fit, module, context, **kwargs):
for x in xrange(1, 5):
if module.getModifiedChargeAttr("warfareBuff{}ID".format(x)):
value = module.getModifiedItemAttr("warfareBuff{}Value".format(x))
id = module.getModifiedChargeAttr("warfareBuff{}ID".format(x))

if id:
fit.addCommandBonus(id, value, module, kwargs['effect'])
fit.addCommandBonus(id, value, module, kwargs['effect'])
6 changes: 2 additions & 4 deletions eos/effects/moduletitaneffectgenerator.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
# Used by:
# Modules from group: Titan Phenomena Generator (4 of 4)
type = "active", "gang"


def handler(fit, module, context, **kwargs):
for x in xrange(1, 5):
if module.getModifiedItemAttr("warfareBuff{}ID".format(x)):
Expand All @@ -11,7 +13,3 @@ def handler(fit, module, context, **kwargs):

if id:
fit.addCommandBonus(id, value, module, kwargs['effect'])




3 changes: 2 additions & 1 deletion eos/effects/remotehullrepair.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@


def handler(fit, module, context):
if "projected" not in context: return
if "projected" not in context:
return
bonus = module.getModifiedItemAttr("structureDamageAmount")
duration = module.getModifiedItemAttr("duration") / 1000.0
fit.extraAttributes.increase("hullRepair", bonus / duration)
2 changes: 2 additions & 0 deletions eos/effects/rolebonusremotearmorrepairoptimalfalloff.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
# Used by:
# Ship: Rabisu
type = "passive"


def handler(fit, src, context):
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Remote Armor Repair Systems"), "falloffEffectiveness", src.getModifiedItemAttr("roleBonusRepairRange"))
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Remote Armor Repair Systems"), "maxRange", src.getModifiedItemAttr("roleBonusRepairRange"))
2 changes: 2 additions & 0 deletions eos/effects/shipbonusforceauxiliarya4warfarelinksbonus.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
# Used by:
# Ship: Apostle
type = "passive"


def handler(fit, src, context):
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Armored Command") or mod.item.requiresSkill("Information Command"), "warfareBuff4Value", src.getModifiedItemAttr("shipBonusForceAuxiliaryA4"), skill="Amarr Carrier")
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Armored Command") or mod.item.requiresSkill("Information Command"), "warfareBuff3Value", src.getModifiedItemAttr("shipBonusForceAuxiliaryA4"), skill="Amarr Carrier")
Expand Down
2 changes: 1 addition & 1 deletion eos/effects/shipmodesmallmissiledamagepostdiv.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ def handler(fit, module, context):
fit.modules.filteredChargeMultiply(lambda mod: mod.charge.requiresSkill("Rockets") or mod.charge.requiresSkill("Light Missiles"),
"{}Damage".format(type),
1 / module.getModifiedItemAttr("modeDamageBonusPostDiv"),
stackingPenalties = True,
stackingPenalties=True,
penaltyGroup="postDiv")
1 change: 0 additions & 1 deletion eos/effects/structurerigmaxtargets.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@

def handler(fit, src, context):
fit.extraAttributes.increase("maxTargetsLockedFromSkills", src.getModifiedItemAttr("structureRigMaxTargetBonus"))

4 changes: 0 additions & 4 deletions eos/saveddata/fighter.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,6 @@ def isInvalid(self):
def item(self):
return self.__item

@property
def charge(self):
return self.__charge

@property
def hasAmmo(self):
return self.charge is not None
Expand Down
11 changes: 4 additions & 7 deletions eos/saveddata/fit.py
Original file line number Diff line number Diff line change
Expand Up @@ -487,11 +487,9 @@ def __runCommandBoosts(self, runTime="normal"):
self.ship.boostItemAttr("armor%sDamageResonance" % damageType, value)

if warfareBuffID == 14: # Armor Burst: Rapid Repair: Repair Duration/Capacitor
self.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill(
"Remote Armor Repair Systems") or mod.item.requiresSkill("Repair Systems"),
self.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Remote Armor Repair Systems") or mod.item.requiresSkill("Repair Systems"),
"capacitorNeed", value)
self.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill(
"Remote Armor Repair Systems") or mod.item.requiresSkill("Repair Systems"), "duration",
self.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Remote Armor Repair Systems") or mod.item.requiresSkill("Repair Systems"), "duration",
value)

if warfareBuffID == 15: # Armor Burst: Armor Reinforcement: Armor HP
Expand All @@ -512,9 +510,8 @@ def __runCommandBoosts(self, runTime="normal"):
"scan%sStrengthBonus" % scanType, value,
stackingPenalties=True)

for attr in (
"missileVelocityBonus", "explosionDelayBonus", "aoeVelocityBonus", "falloffBonus",
"maxRangeBonus", "aoeCloudSizeBonus", "trackingSpeedBonus"):
for attr in ("missileVelocityBonus", "explosionDelayBonus", "aoeVelocityBonus", "falloffBonus",
"maxRangeBonus", "aoeCloudSizeBonus", "trackingSpeedBonus"):
self.modules.filteredItemBoost(lambda mod: mod.item.group.name == "Weapon Disruptor",
attr, value)

Expand Down
6 changes: 3 additions & 3 deletions gui/builtinPreferenceViews/pyfaCrestPreferences.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@

import gui.mainFrame

if 'wxMac' not in wx.PlatformInfo or ('wxMac' in wx.PlatformInfo and wx.VERSION >= (3, 0)):
from service.crest import Crest

from service.settings import CRESTSettings

from wx.lib.intctrl import IntCtrl

if 'wxMac' not in wx.PlatformInfo or ('wxMac' in wx.PlatformInfo and wx.VERSION >= (3, 0)):
from service.crest import Crest


class PFCrestPref(PreferenceView):
title = "CREST"
Expand Down
2 changes: 1 addition & 1 deletion gui/builtinStatsViews/miningyieldViewFull.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def switchToFirepowerView(self, event):
def refreshPanel(self, fit):
# If we did anything intresting, we'd update our labels to reflect the new fit's stats here

stats = (("labelFullminingyieldMiner", lambda: fit.minerYield, 3, 0, 0, u"%s m\u00B3/s",None),
stats = (("labelFullminingyieldMiner", lambda: fit.minerYield, 3, 0, 0, u"%s m\u00B3/s", None),
("labelFullminingyieldDrone", lambda: fit.droneYield, 3, 0, 0, u"%s m\u00B3/s", None),
("labelFullminingyieldTotal", lambda: fit.totalYield, 3, 0, 0, u"%s m\u00B3/s", None))

Expand Down
6 changes: 3 additions & 3 deletions gui/builtinViews/fittingView.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ def startDrag(self, event):

if row != -1 and row not in self.blanks:
data = wx.PyTextDataObject()
data.SetText("fitting:"+str(self.mods[row].modPosition))
data.SetText("fitting:" + str(self.mods[row].modPosition))

dropSource = wx.DropSource(self)
dropSource.SetData(data)
Expand Down Expand Up @@ -403,7 +403,7 @@ def swapItems(self, x, y, srcIdx):
return

if clone and mod2.isEmpty:
sFit.cloneModule(self.mainFrame.getActiveFit(), srcIdx, mod2.modPosition)
sFit.cloneModule(self.mainFrame.getActiveFit(), srcIdx, mod2.modPosition)
else:
sFit.swapModules(self.mainFrame.getActiveFit(), srcIdx, mod2.modPosition)

Expand Down Expand Up @@ -503,7 +503,7 @@ def spawnMenu(self):

itemContext = "Tactical Mode"
fullContext = (srcContext, itemContext)
if not srcContext in tuple(fCtxt[0] for fCtxt in contexts):
if srcContext not in tuple(fCtxt[0] for fCtxt in contexts):
contexts.append(fullContext)

selection.append(mod)
Expand Down
6 changes: 3 additions & 3 deletions gui/crestFittings.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
import wx
import requests

if not 'wxMac' in wx.PlatformInfo or ('wxMac' in wx.PlatformInfo and wx.VERSION >= (3,0)):
from service.crest import Crest, CrestModes

from service.port import Port
from service.fit import Fit

Expand All @@ -16,6 +13,9 @@
import gui.display as d
import gui.globalEvents as GE

if 'wxMac' not in wx.PlatformInfo or ('wxMac' in wx.PlatformInfo and wx.VERSION >= (3, 0)):
from service.crest import Crest, CrestModes


class CrestFittings(wx.Frame):
def __init__(self, parent):
Expand Down
4 changes: 3 additions & 1 deletion gui/graphFrame.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

import os
import logging
logger = logging.getLogger(__name__)

import wx

Expand All @@ -39,6 +38,9 @@
mplImported = False
except ImportError:
enabled = False

logger = logging.getLogger(__name__)
if not enabled:
logger.info("Problems importing matplotlib; continuing without graphs")


Expand Down
1 change: 0 additions & 1 deletion gui/itemStats.py
Original file line number Diff line number Diff line change
Expand Up @@ -834,7 +834,6 @@ def OnRightClick(self, event):
If effect file does not exist, create it
"""

import os
file_ = config.getPyfaPath(os.path.join("eos", "effects", "%s.py" % event.GetText().lower()))

if not os.path.isfile(file_):
Expand Down
2 changes: 2 additions & 0 deletions gui/marketBrowser.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
RECENTLY_USED_MODULES = -2
MAX_RECENTLY_USED_MODULES = 20


class MetaButton(wx.ToggleButton):
def __init__(self, *args, **kwargs):
super(MetaButton, self).__init__(*args, **kwargs)
Expand All @@ -50,6 +51,7 @@ def reset(self):
self.Enable(True)
self.SetValue(self.userSelected)


class MarketBrowser(wx.Panel):
def __init__(self, parent):
wx.Panel.__init__(self, parent)
Expand Down
Loading

0 comments on commit be66ff1

Please sign in to comment.