Some tox fixes
This commit is contained in:
@@ -230,7 +230,6 @@ def defLogging():
|
||||
])
|
||||
|
||||
|
||||
|
||||
class LoggerWriter(object):
|
||||
def __init__(self, level):
|
||||
# self.level is really like using log.debug(message)
|
||||
|
||||
@@ -258,6 +258,7 @@ class HandledProjectedModList(HandledList):
|
||||
return oldEffect.itemID
|
||||
return None
|
||||
|
||||
|
||||
class HandledProjectedDroneList(HandledDroneCargoList):
|
||||
def append(self, proj):
|
||||
proj.projected = True
|
||||
|
||||
@@ -28,6 +28,7 @@ from gui.utils.staticHelpers import DragDropHelper
|
||||
from service.fit import Fit
|
||||
import gui.fitCommands as cmd
|
||||
|
||||
|
||||
class BoosterViewDrop(wx.DropTarget):
|
||||
def __init__(self, dropFn, *args, **kwargs):
|
||||
super(BoosterViewDrop, self).__init__(*args, **kwargs)
|
||||
|
||||
@@ -32,6 +32,7 @@ from gui.utils.staticHelpers import DragDropHelper
|
||||
from service.fit import Fit
|
||||
import gui.fitCommands as cmd
|
||||
|
||||
|
||||
class DummyItem(object):
|
||||
def __init__(self, txt):
|
||||
self.name = txt
|
||||
@@ -100,7 +101,6 @@ class CommandView(d.Display):
|
||||
keycode = event.GetKeyCode()
|
||||
if keycode == wx.WXK_DELETE or keycode == wx.WXK_NUMPAD_DELETE:
|
||||
fitID = self.mainFrame.getActiveFit()
|
||||
sFit = Fit.getInstance()
|
||||
row = self.GetFirstSelected()
|
||||
if row != -1:
|
||||
self.mainFrame.command.Submit(cmd.GuiRemoveCommandCommand(fitID, self.get(row).ID))
|
||||
@@ -218,7 +218,6 @@ class CommandView(d.Display):
|
||||
col = self.getColumn(event.Position)
|
||||
if col != self.getColIndex(State):
|
||||
fitID = self.mainFrame.getActiveFit()
|
||||
sFit = Fit.getInstance()
|
||||
thing = self.get(row)
|
||||
if thing: # thing doesn't exist if it's the dummy value
|
||||
self.mainFrame.command.Submit(cmd.GuiRemoveCommandCommand(fitID, thing.ID))
|
||||
|
||||
@@ -31,6 +31,7 @@ from service.fit import Fit
|
||||
from service.market import Market
|
||||
import gui.fitCommands as cmd
|
||||
|
||||
|
||||
class DroneViewDrop(wx.DropTarget):
|
||||
def __init__(self, dropFn, *args, **kwargs):
|
||||
super(DroneViewDrop, self).__init__(*args, **kwargs)
|
||||
|
||||
@@ -30,6 +30,7 @@ from service.fit import Fit
|
||||
from service.market import Market
|
||||
import gui.fitCommands as cmd
|
||||
|
||||
|
||||
class ImplantView(wx.Panel):
|
||||
def __init__(self, parent):
|
||||
wx.Panel.__init__(self, parent, id=wx.ID_ANY, pos=wx.DefaultPosition, style=wx.TAB_TRAVERSAL)
|
||||
|
||||
@@ -322,7 +322,6 @@ class ProjectedView(d.Display):
|
||||
col = self.getColumn(event.Position)
|
||||
if col != self.getColIndex(State):
|
||||
fitID = self.mainFrame.getActiveFit()
|
||||
sFit = Fit.getInstance()
|
||||
thing = self.get(row)
|
||||
if thing: # thing doesn't exist if it's the dummy value
|
||||
self.mainFrame.command.Submit(cmd.GuiRemoveProjectedCommand(fitID, thing))
|
||||
|
||||
@@ -12,6 +12,7 @@ from eos.saveddata.fighter import Fighter as es_Fighter
|
||||
from service.settings import ContextMenuSettings
|
||||
import gui.fitCommands as cmd
|
||||
|
||||
|
||||
class ChangeAmount(ContextMenu):
|
||||
def __init__(self):
|
||||
self.mainFrame = gui.mainFrame.MainFrame.getInstance()
|
||||
|
||||
@@ -6,6 +6,7 @@ from service.settings import ContextMenuSettings
|
||||
from service.fit import Fit
|
||||
import gui.fitCommands as cmd
|
||||
|
||||
|
||||
class CargoAmmo(ContextMenu):
|
||||
def __init__(self):
|
||||
self.mainFrame = gui.mainFrame.MainFrame.getInstance()
|
||||
|
||||
@@ -9,6 +9,7 @@ from gui.contextMenu import ContextMenu
|
||||
from service.settings import ContextMenuSettings
|
||||
import gui.fitCommands as cmd
|
||||
|
||||
|
||||
class CommandFits(ContextMenu):
|
||||
# Get list of items that define a command fit
|
||||
sMkt = Market.getInstance()
|
||||
@@ -97,7 +98,6 @@ class CommandFits(ContextMenu):
|
||||
event.Skip()
|
||||
return
|
||||
|
||||
sFit = Fit.getInstance()
|
||||
fitID = self.mainFrame.getActiveFit()
|
||||
self.mainFrame.command.Submit(cmd.GuiAddCommandCommand(fitID, fit.ID))
|
||||
|
||||
|
||||
@@ -111,7 +111,6 @@ class DroneStackSplit(wx.Dialog):
|
||||
return False
|
||||
|
||||
|
||||
|
||||
class DroneSpinner(wx.Dialog):
|
||||
def __init__(self, parent, drone, context):
|
||||
wx.Dialog.__init__(self, parent, title="Select Amount", size=wx.Size(220, 60))
|
||||
|
||||
@@ -7,6 +7,7 @@ from service.fit import Fit
|
||||
from service.settings import ContextMenuSettings
|
||||
import gui.fitCommands as cmd
|
||||
|
||||
|
||||
class ItemRemove(ContextMenu):
|
||||
def __init__(self):
|
||||
self.mainFrame = gui.mainFrame.MainFrame.getInstance()
|
||||
|
||||
@@ -17,6 +17,7 @@ from eos.saveddata.implant import Implant
|
||||
from eos.saveddata.cargo import Cargo
|
||||
import gui.fitCommands as cmd
|
||||
|
||||
|
||||
class MetaSwap(ContextMenu):
|
||||
def __init__(self):
|
||||
self.mainFrame = gui.mainFrame.MainFrame.getInstance()
|
||||
@@ -153,5 +154,4 @@ class MetaSwap(ContextMenu):
|
||||
# sFit.addDrone(fitID, item.ID, drone_count, True)
|
||||
|
||||
|
||||
|
||||
MetaSwap.register()
|
||||
|
||||
@@ -13,6 +13,7 @@ from gui.bitmap_loader import BitmapLoader
|
||||
from service.settings import ContextMenuSettings
|
||||
import gui.fitCommands as cmd
|
||||
|
||||
|
||||
class ModuleAmmoPicker(ContextMenu):
|
||||
DAMAGE_TYPES = ("em", "explosive", "kinetic", "thermal")
|
||||
MISSILE_ORDER = ("em", "thermal", "kinetic", "explosive", "mixed")
|
||||
|
||||
@@ -9,6 +9,7 @@ from service.fit import Fit
|
||||
from service.settings import ContextMenuSettings
|
||||
import gui.fitCommands as cmd
|
||||
|
||||
|
||||
class ModuleGlobalAmmoPicker(ModuleAmmoPicker):
|
||||
def __init__(self):
|
||||
super(ModuleGlobalAmmoPicker, self).__init__()
|
||||
@@ -28,7 +29,6 @@ class ModuleGlobalAmmoPicker(ModuleAmmoPicker):
|
||||
event.Skip()
|
||||
return
|
||||
|
||||
sFit = Fit.getInstance()
|
||||
fitID = self.mainFrame.getActiveFit()
|
||||
fit = db_getFit(fitID)
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ from service.fit import Fit
|
||||
from service.settings import ContextMenuSettings
|
||||
import gui.fitCommands as cmd
|
||||
|
||||
|
||||
class Project(ContextMenu):
|
||||
def __init__(self):
|
||||
self.mainFrame = gui.mainFrame.MainFrame.getInstance()
|
||||
@@ -33,7 +34,6 @@ class Project(ContextMenu):
|
||||
return "Project {0} onto Fit".format(itmContext)
|
||||
|
||||
def activate(self, fullContext, selection, i):
|
||||
sFit = Fit.getInstance()
|
||||
fitID = self.mainFrame.getActiveFit()
|
||||
self.mainFrame.command.Submit(cmd.GuiAddProjectedCommand(fitID, selection[0].ID, 'item'))
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ from gui.contextMenu import ContextMenu
|
||||
from gui.builtinViews.emptyView import BlankPage
|
||||
import gui.fitCommands as cmd
|
||||
|
||||
|
||||
class TabbedFits(ContextMenu):
|
||||
def __init__(self):
|
||||
self.mainFrame = gui.mainFrame.MainFrame.getInstance()
|
||||
|
||||
@@ -8,6 +8,7 @@ from service.fit import Fit
|
||||
from service.settings import ContextMenuSettings
|
||||
import gui.fitCommands as cmd
|
||||
|
||||
|
||||
class TacticalMode(ContextMenu):
|
||||
def __init__(self):
|
||||
self.mainFrame = gui.mainFrame.MainFrame.getInstance()
|
||||
|
||||
@@ -10,6 +10,7 @@ from itertools import chain
|
||||
import re
|
||||
import gui.fitCommands as cmd
|
||||
|
||||
|
||||
class WhProjector(ContextMenu):
|
||||
|
||||
# CCP doesn't currently provide a mapping between the general Environment, and the specific environment effect
|
||||
|
||||
@@ -20,6 +20,7 @@ from service.fit import Fit
|
||||
import gui.fitCommands as cmd
|
||||
pyfalog = Logger(__name__)
|
||||
|
||||
|
||||
class FitItem(SFItem.SFBrowserItem):
|
||||
def __init__(self, parent, fitID=None, shipFittingInfo=("Test", "TestTrait", "cnc's avatar", 0, 0, None), shipID=None,
|
||||
itemData=None, graphicID=None,
|
||||
|
||||
@@ -450,7 +450,6 @@ class FittingView(d.Display):
|
||||
mod1 = fit.modules[srcIdx]
|
||||
mod2 = self.mods[dstRow]
|
||||
|
||||
|
||||
if not isinstance(mod2, Module):
|
||||
return
|
||||
|
||||
@@ -622,7 +621,8 @@ class FittingView(d.Display):
|
||||
ctrl = event.cmdDown or event.middleIsDown
|
||||
click = "ctrl" if ctrl is True else "right" if event.GetButton() == 3 else "left"
|
||||
|
||||
self.mainFrame.command.Submit(cmd.GuiModuleStateChangeCommand(fitID, self.mods[self.GetItemData(row)].modPosition, [mod.modPosition for mod in mods], click))
|
||||
self.mainFrame.command.Submit(cmd.GuiModuleStateChangeCommand(
|
||||
fitID, self.mods[self.GetItemData(row)].modPosition, [mod.modPosition for mod in mods], click))
|
||||
|
||||
# update state tooltip
|
||||
tooltip = self.activeColumns[col].getToolTip(self.mods[self.GetItemData(row)])
|
||||
|
||||
@@ -186,7 +186,7 @@ from gui.builtinContextMenus import ( # noqa: E402,F401
|
||||
itemStats,
|
||||
damagePattern,
|
||||
marketJump,
|
||||
#droneSplit,
|
||||
# droneSplit,
|
||||
itemRemove,
|
||||
droneRemoveStack,
|
||||
ammoPattern,
|
||||
@@ -202,7 +202,7 @@ from gui.builtinContextMenus import ( # noqa: E402,F401
|
||||
priceOptions,
|
||||
amount,
|
||||
cargoAmmo,
|
||||
#droneStack,
|
||||
# droneStack,
|
||||
metaSwap,
|
||||
implantSets,
|
||||
fighterAbilities,
|
||||
|
||||
@@ -88,7 +88,7 @@ class DevTools(wx.Dialog):
|
||||
print(None)
|
||||
|
||||
def cmd_print(self, evt):
|
||||
print("="*20)
|
||||
print("=" * 20)
|
||||
for x in self.mainFrame.command.GetCommands():
|
||||
print("{}{} {}".format("==> " if x == self.mainFrame.command.GetCurrentCommand() else "", x.GetName(), x))
|
||||
|
||||
|
||||
@@ -1,14 +1,9 @@
|
||||
import wx
|
||||
from service.fit import Fit
|
||||
|
||||
import gui.mainFrame
|
||||
from gui import globalEvents as GE
|
||||
#from .helpers import ModuleInfoCache
|
||||
from eos.saveddata.module import Module, State
|
||||
import eos.db
|
||||
from logbook import Logger
|
||||
pyfalog = Logger(__name__)
|
||||
from eos.saveddata.booster import Booster
|
||||
pyfalog = Logger(__name__)
|
||||
|
||||
|
||||
class FitAddBoosterCommand(wx.Command):
|
||||
""""
|
||||
@@ -20,7 +15,7 @@ class FitAddBoosterCommand(wx.Command):
|
||||
self.itemID = itemID
|
||||
self.new_index = None
|
||||
self.old_item = None
|
||||
|
||||
|
||||
def Do(self):
|
||||
pyfalog.debug("Adding booster ({0}) to fit ID: {1}", self.itemID, self.fitID)
|
||||
|
||||
|
||||
@@ -1,14 +1,9 @@
|
||||
import wx
|
||||
from service.fit import Fit
|
||||
|
||||
import gui.mainFrame
|
||||
from gui import globalEvents as GE
|
||||
#from .helpers import ModuleInfoCache
|
||||
from eos.saveddata.module import Module, State
|
||||
import eos.db
|
||||
from logbook import Logger
|
||||
pyfalog = Logger(__name__)
|
||||
from eos.saveddata.cargo import Cargo
|
||||
pyfalog = Logger(__name__)
|
||||
|
||||
|
||||
class FitAddCargoCommand(wx.Command):
|
||||
""""
|
||||
|
||||
@@ -1,10 +1,4 @@
|
||||
import wx
|
||||
from service.fit import Fit
|
||||
|
||||
import gui.mainFrame
|
||||
from gui import globalEvents as GE
|
||||
#from .helpers import ModuleInfoCache
|
||||
from eos.saveddata.module import Module, State
|
||||
import eos.db
|
||||
from logbook import Logger
|
||||
pyfalog = Logger(__name__)
|
||||
|
||||
@@ -1,14 +1,9 @@
|
||||
import wx
|
||||
from service.fit import Fit
|
||||
|
||||
import gui.mainFrame
|
||||
from gui import globalEvents as GE
|
||||
#from .helpers import ModuleInfoCache
|
||||
from eos.saveddata.module import Module, State
|
||||
import eos.db
|
||||
from logbook import Logger
|
||||
pyfalog = Logger(__name__)
|
||||
from eos.saveddata.drone import Drone
|
||||
pyfalog = Logger(__name__)
|
||||
|
||||
|
||||
class FitAddDroneCommand(wx.Command):
|
||||
""""
|
||||
|
||||
@@ -1,14 +1,9 @@
|
||||
import wx
|
||||
from service.fit import Fit
|
||||
|
||||
import gui.mainFrame
|
||||
from gui import globalEvents as GE
|
||||
#from .helpers import ModuleInfoCache
|
||||
from eos.saveddata.module import Module, State
|
||||
import eos.db
|
||||
from logbook import Logger
|
||||
pyfalog = Logger(__name__)
|
||||
from eos.saveddata.fighter import Fighter
|
||||
pyfalog = Logger(__name__)
|
||||
|
||||
|
||||
class FitAddFighterCommand(wx.Command):
|
||||
""""
|
||||
|
||||
@@ -1,14 +1,9 @@
|
||||
import wx
|
||||
from service.fit import Fit
|
||||
|
||||
import gui.mainFrame
|
||||
from gui import globalEvents as GE
|
||||
#from .helpers import ModuleInfoCache
|
||||
from eos.saveddata.module import Module, State
|
||||
import eos.db
|
||||
from logbook import Logger
|
||||
pyfalog = Logger(__name__)
|
||||
from eos.saveddata.implant import Implant
|
||||
pyfalog = Logger(__name__)
|
||||
|
||||
|
||||
class FitAddImplantCommand(wx.Command):
|
||||
""""
|
||||
|
||||
@@ -1,9 +1,4 @@
|
||||
import wx
|
||||
from service.fit import Fit
|
||||
|
||||
import gui.mainFrame
|
||||
from gui import globalEvents as GE
|
||||
#from .helpers import ModuleInfoCache
|
||||
from eos.saveddata.module import Module, State
|
||||
import eos.db
|
||||
from logbook import Logger
|
||||
@@ -64,7 +59,7 @@ class FitAddModuleCommand(wx.Command):
|
||||
# Then, check states of all modules and change where needed. This will recalc if needed
|
||||
# self.checkStates(fit, m)
|
||||
|
||||
#fit.fill()
|
||||
# fit.fill()
|
||||
eos.db.commit()
|
||||
|
||||
self.change = numSlots != len(fit.modules)
|
||||
|
||||
@@ -1,16 +1,7 @@
|
||||
import wx
|
||||
from service.fit import Fit
|
||||
|
||||
import gui.mainFrame
|
||||
from gui import globalEvents as GE
|
||||
#from .helpers import ModuleInfoCache
|
||||
from eos.saveddata.module import Module, State
|
||||
import eos.db
|
||||
from logbook import Logger
|
||||
from eos.saveddata.module import Module
|
||||
from eos.saveddata.drone import Drone
|
||||
from eos.saveddata.fighter import Fighter
|
||||
from .fitRemoveProjectedModule import FitRemoveProjectedModuleCommand
|
||||
pyfalog = Logger(__name__)
|
||||
|
||||
|
||||
|
||||
@@ -1,16 +1,7 @@
|
||||
import wx
|
||||
from service.fit import Fit
|
||||
|
||||
import gui.mainFrame
|
||||
from gui import globalEvents as GE
|
||||
#from .helpers import ModuleInfoCache
|
||||
from eos.saveddata.module import Module, State
|
||||
import eos.db
|
||||
from logbook import Logger
|
||||
from eos.saveddata.module import Module
|
||||
from eos.saveddata.drone import Drone
|
||||
from eos.saveddata.fighter import Fighter
|
||||
from .fitRemoveProjectedModule import FitRemoveProjectedModuleCommand
|
||||
pyfalog = Logger(__name__)
|
||||
|
||||
|
||||
|
||||
@@ -1,14 +1,7 @@
|
||||
import wx
|
||||
from service.fit import Fit
|
||||
|
||||
import gui.mainFrame
|
||||
from gui import globalEvents as GE
|
||||
#from .helpers import ModuleInfoCache
|
||||
from eos.saveddata.module import Module, State
|
||||
import eos.db
|
||||
from logbook import Logger
|
||||
from eos.saveddata.fighter import Fighter
|
||||
from eos.saveddata.drone import Drone
|
||||
pyfalog = Logger(__name__)
|
||||
|
||||
|
||||
|
||||
@@ -1,16 +1,6 @@
|
||||
import wx
|
||||
from service.fit import Fit
|
||||
|
||||
import gui.mainFrame
|
||||
from gui import globalEvents as GE
|
||||
#from .helpers import ModuleInfoCache
|
||||
from eos.saveddata.module import Module, State
|
||||
import eos.db
|
||||
from logbook import Logger
|
||||
from eos.saveddata.module import Module
|
||||
from eos.saveddata.drone import Drone
|
||||
from eos.saveddata.fighter import Fighter
|
||||
from .fitRemoveProjectedModule import FitRemoveProjectedModuleCommand
|
||||
pyfalog = Logger(__name__)
|
||||
|
||||
|
||||
|
||||
@@ -1,15 +1,7 @@
|
||||
import wx
|
||||
from service.fit import Fit
|
||||
|
||||
import gui.mainFrame
|
||||
from gui import globalEvents as GE
|
||||
#from .helpers import ModuleInfoCache
|
||||
from eos.saveddata.module import Module, State
|
||||
import eos.db
|
||||
from logbook import Logger
|
||||
from eos.saveddata.module import Module
|
||||
from eos.saveddata.drone import Drone
|
||||
from eos.saveddata.fighter import Fighter
|
||||
from eos.saveddata.module import Module, State
|
||||
pyfalog = Logger(__name__)
|
||||
|
||||
|
||||
|
||||
@@ -1,14 +1,8 @@
|
||||
import wx
|
||||
from service.fit import Fit
|
||||
|
||||
import gui.mainFrame
|
||||
from gui import globalEvents as GE
|
||||
#from .helpers import ModuleInfoCache
|
||||
from eos.saveddata.module import Module, State
|
||||
import eos.db
|
||||
from logbook import Logger
|
||||
pyfalog = Logger(__name__)
|
||||
from eos.saveddata.drone import Drone
|
||||
|
||||
|
||||
class FitChangeCargoQty(wx.Command):
|
||||
def __init__(self, fitID, position, amount=1):
|
||||
|
||||
@@ -1,14 +1,9 @@
|
||||
import wx
|
||||
from service.fit import Fit
|
||||
|
||||
import gui.mainFrame
|
||||
from gui import globalEvents as GE
|
||||
#from .helpers import ModuleInfoCache
|
||||
from eos.saveddata.module import Module, State
|
||||
import eos.db
|
||||
from logbook import Logger
|
||||
pyfalog = Logger(__name__)
|
||||
|
||||
|
||||
class FitChangeDroneQty(wx.Command):
|
||||
def __init__(self, fitID, position, amount=1):
|
||||
wx.Command.__init__(self, True, "Drone add")
|
||||
|
||||
@@ -1,14 +1,8 @@
|
||||
import wx
|
||||
from service.fit import Fit
|
||||
|
||||
import gui.mainFrame
|
||||
from gui import globalEvents as GE
|
||||
#from .helpers import ModuleInfoCache
|
||||
from eos.saveddata.module import Module, State
|
||||
import eos.db
|
||||
from logbook import Logger
|
||||
pyfalog = Logger(__name__)
|
||||
from eos.saveddata.drone import Drone
|
||||
|
||||
|
||||
class FitChangeFighterQty(wx.Command):
|
||||
""""
|
||||
|
||||
@@ -1,14 +1,9 @@
|
||||
import wx
|
||||
from service.fit import Fit
|
||||
|
||||
import gui.mainFrame
|
||||
from gui import globalEvents as GE
|
||||
#from .helpers import ModuleInfoCache
|
||||
from eos.saveddata.module import Module, State
|
||||
import eos.db
|
||||
from logbook import Logger
|
||||
pyfalog = Logger(__name__)
|
||||
|
||||
|
||||
class FitChangeProjectedDroneQty(wx.Command):
|
||||
def __init__(self, fitID, position, amount=1):
|
||||
wx.Command.__init__(self, True, "Drone add")
|
||||
|
||||
@@ -1,14 +1,9 @@
|
||||
import wx
|
||||
from service.fit import Fit
|
||||
|
||||
import gui.mainFrame
|
||||
from gui import globalEvents as GE
|
||||
#from .helpers import ModuleInfoCache
|
||||
from eos.saveddata.module import Module, State
|
||||
import eos.db
|
||||
from logbook import Logger
|
||||
pyfalog = Logger(__name__)
|
||||
|
||||
|
||||
class FitChangeProjectedFitQty(wx.Command):
|
||||
""""
|
||||
from sFit.changeAmount
|
||||
@@ -21,7 +16,6 @@ class FitChangeProjectedFitQty(wx.Command):
|
||||
self.old_amount = None
|
||||
|
||||
def Do(self):
|
||||
fit = eos.db.getFit(self.fitID)
|
||||
pfit = eos.db.getFit(self.pfitID)
|
||||
|
||||
if not pfit: # fit was deleted
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
import wx
|
||||
from service.fit import Fit
|
||||
from logbook import Logger
|
||||
|
||||
import gui.mainFrame
|
||||
from gui import globalEvents as GE
|
||||
from logbook import Logger
|
||||
from eos.saveddata.module import Module
|
||||
pyfalog = Logger(__name__)
|
||||
from service.fit import Fit
|
||||
import eos.db
|
||||
|
||||
pyfalog = Logger(__name__)
|
||||
|
||||
|
||||
class FitChangeStatesCommand(wx.Command):
|
||||
"""
|
||||
Fitting command that trys to change the state of modules in [positions]. We use the base module to determine the
|
||||
|
||||
@@ -1,14 +1,9 @@
|
||||
import wx
|
||||
from service.fit import Fit
|
||||
|
||||
import gui.mainFrame
|
||||
from gui import globalEvents as GE
|
||||
#from .helpers import ModuleInfoCache
|
||||
from eos.saveddata.module import Module, State
|
||||
import eos.db
|
||||
from logbook import Logger
|
||||
pyfalog = Logger(__name__)
|
||||
import copy
|
||||
pyfalog = Logger(__name__)
|
||||
|
||||
|
||||
class FitCloneModuleCommand(wx.Command):
|
||||
"""
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
import wx
|
||||
|
||||
#from .helpers import ModuleInfoCache
|
||||
import eos.db
|
||||
from logbook import Logger
|
||||
pyfalog = Logger(__name__)
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
import wx
|
||||
|
||||
#from .helpers import ModuleInfoCache
|
||||
import eos.db
|
||||
from logbook import Logger
|
||||
pyfalog = Logger(__name__)
|
||||
|
||||
@@ -1,16 +1,10 @@
|
||||
import wx
|
||||
from service.fit import Fit
|
||||
|
||||
import gui.mainFrame
|
||||
from gui import globalEvents as GE
|
||||
#from .helpers import ModuleInfoCache
|
||||
from eos.saveddata.module import Module, State
|
||||
import eos.db
|
||||
from logbook import Logger
|
||||
pyfalog = Logger(__name__)
|
||||
|
||||
|
||||
class FitRemoveCommandCommand(wx.Command): # well that's an unfrtunate name
|
||||
class FitRemoveCommandCommand(wx.Command): # well that's an unfortunate name
|
||||
""""
|
||||
from sFit.removeCommand
|
||||
"""
|
||||
|
||||
@@ -1,14 +1,8 @@
|
||||
import wx
|
||||
from service.fit import Fit
|
||||
|
||||
import gui.mainFrame
|
||||
from gui import globalEvents as GE
|
||||
#from .helpers import ModuleInfoCache
|
||||
from eos.saveddata.module import Module, State
|
||||
import eos.db
|
||||
from logbook import Logger
|
||||
pyfalog = Logger(__name__)
|
||||
from eos.saveddata.drone import Drone
|
||||
|
||||
|
||||
class FitRemoveDroneCommand(wx.Command):
|
||||
""""
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
import wx
|
||||
|
||||
#from .helpers import ModuleInfoCache
|
||||
import eos.db
|
||||
from logbook import Logger
|
||||
pyfalog = Logger(__name__)
|
||||
@@ -28,7 +26,7 @@ class FitRemoveImplantCommand(wx.Command):
|
||||
return True
|
||||
|
||||
def Undo(self):
|
||||
from gui.fitCommands.calc.fitAddImplant import FitAddImplantCommand # Avoid circular import
|
||||
from gui.fitCommands.calc.fitAddImplant import FitAddImplantCommand # Avoid circular import
|
||||
cmd = FitAddImplantCommand(self.fitID, self.old_implant)
|
||||
cmd.Do()
|
||||
return True
|
||||
|
||||
@@ -1,15 +1,6 @@
|
||||
import wx
|
||||
from service.fit import Fit
|
||||
|
||||
import gui.mainFrame
|
||||
from gui import globalEvents as GE
|
||||
#from .helpers import ModuleInfoCache
|
||||
from eos.saveddata.module import Module, State
|
||||
import eos.db
|
||||
from logbook import Logger
|
||||
from eos.saveddata.module import Module
|
||||
from eos.saveddata.drone import Drone
|
||||
from eos.saveddata.fighter import Fighter
|
||||
pyfalog = Logger(__name__)
|
||||
|
||||
|
||||
|
||||
@@ -1,15 +1,6 @@
|
||||
import wx
|
||||
from service.fit import Fit
|
||||
|
||||
import gui.mainFrame
|
||||
from gui import globalEvents as GE
|
||||
#from .helpers import ModuleInfoCache
|
||||
from eos.saveddata.module import Module, State
|
||||
import eos.db
|
||||
from logbook import Logger
|
||||
from eos.saveddata.module import Module
|
||||
from eos.saveddata.drone import Drone
|
||||
from eos.saveddata.fighter import Fighter
|
||||
from .fitRemoveProjectedModule import FitRemoveProjectedModuleCommand
|
||||
pyfalog = Logger(__name__)
|
||||
|
||||
|
||||
@@ -1,16 +1,6 @@
|
||||
import wx
|
||||
from service.fit import Fit
|
||||
|
||||
import gui.mainFrame
|
||||
from gui import globalEvents as GE
|
||||
#from .helpers import ModuleInfoCache
|
||||
from eos.saveddata.module import Module, State
|
||||
import eos.db
|
||||
from logbook import Logger
|
||||
from eos.saveddata.module import Module
|
||||
from eos.saveddata.drone import Drone
|
||||
from eos.saveddata.fighter import Fighter
|
||||
from .fitRemoveProjectedModule import FitRemoveProjectedModuleCommand
|
||||
pyfalog = Logger(__name__)
|
||||
|
||||
|
||||
|
||||
@@ -1,15 +1,6 @@
|
||||
import wx
|
||||
from service.fit import Fit
|
||||
|
||||
import gui.mainFrame
|
||||
from gui import globalEvents as GE
|
||||
#from .helpers import ModuleInfoCache
|
||||
from eos.saveddata.module import Module, State
|
||||
import eos.db
|
||||
from logbook import Logger
|
||||
from eos.saveddata.module import Module
|
||||
from eos.saveddata.drone import Drone
|
||||
from eos.saveddata.fighter import Fighter
|
||||
from .fitRemoveProjectedModule import FitRemoveProjectedModuleCommand
|
||||
pyfalog = Logger(__name__)
|
||||
|
||||
|
||||
@@ -1,15 +1,6 @@
|
||||
import wx
|
||||
from service.fit import Fit
|
||||
|
||||
import gui.mainFrame
|
||||
from gui import globalEvents as GE
|
||||
#from .helpers import ModuleInfoCache
|
||||
from eos.saveddata.module import Module, State
|
||||
import eos.db
|
||||
from logbook import Logger
|
||||
from eos.saveddata.module import Module
|
||||
from eos.saveddata.drone import Drone
|
||||
from eos.saveddata.fighter import Fighter
|
||||
pyfalog = Logger(__name__)
|
||||
|
||||
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
import wx
|
||||
from service.fit import Fit
|
||||
|
||||
import gui.mainFrame
|
||||
from gui import globalEvents as GE
|
||||
#from .helpers import ModuleInfoCache
|
||||
from eos.saveddata.module import Module, State
|
||||
import eos.db
|
||||
from logbook import Logger
|
||||
|
||||
import eos.db
|
||||
|
||||
pyfalog = Logger(__name__)
|
||||
|
||||
|
||||
|
||||
@@ -5,8 +5,9 @@ import gui.mainFrame
|
||||
from gui import globalEvents as GE
|
||||
from eos.saveddata.module import Module
|
||||
from logbook import Logger
|
||||
pyfalog = Logger(__name__)
|
||||
import eos.db
|
||||
pyfalog = Logger(__name__)
|
||||
|
||||
|
||||
class FitSetChargeCommand(wx.Command):
|
||||
def __init__(self, fitID, positions, chargeID=None):
|
||||
@@ -43,4 +44,4 @@ class FitSetChargeCommand(wx.Command):
|
||||
result = True
|
||||
mod.charge = ammo
|
||||
eos.db.commit()
|
||||
return result
|
||||
return result
|
||||
|
||||
@@ -1,10 +1,4 @@
|
||||
import wx
|
||||
from service.fit import Fit
|
||||
|
||||
import gui.mainFrame
|
||||
from gui import globalEvents as GE
|
||||
#from .helpers import ModuleInfoCache
|
||||
from eos.saveddata.module import Module, State
|
||||
import eos.db
|
||||
from logbook import Logger
|
||||
pyfalog = Logger(__name__)
|
||||
|
||||
@@ -1,10 +1,4 @@
|
||||
import wx
|
||||
from service.fit import Fit
|
||||
|
||||
import gui.mainFrame
|
||||
from gui import globalEvents as GE
|
||||
#from .helpers import ModuleInfoCache
|
||||
from eos.saveddata.module import Module, State
|
||||
import eos.db
|
||||
from logbook import Logger
|
||||
pyfalog = Logger(__name__)
|
||||
|
||||
@@ -1,14 +1,9 @@
|
||||
import wx
|
||||
from service.fit import Fit
|
||||
|
||||
import gui.mainFrame
|
||||
from gui import globalEvents as GE
|
||||
#from .helpers import ModuleInfoCache
|
||||
from eos.saveddata.module import Module, State
|
||||
import eos.db
|
||||
from logbook import Logger
|
||||
pyfalog = Logger(__name__)
|
||||
|
||||
|
||||
class FitToggleBoosterCommand(wx.Command):
|
||||
""""
|
||||
from sFit.toggleBooster
|
||||
|
||||
@@ -1,14 +1,8 @@
|
||||
import wx
|
||||
from service.fit import Fit
|
||||
|
||||
import gui.mainFrame
|
||||
from gui import globalEvents as GE
|
||||
#from .helpers import ModuleInfoCache
|
||||
from eos.saveddata.module import Module, State
|
||||
import eos.db
|
||||
from logbook import Logger
|
||||
pyfalog = Logger(__name__)
|
||||
from eos.saveddata.implant import Implant
|
||||
|
||||
|
||||
class FitToggleCommandCommand(wx.Command):
|
||||
""""
|
||||
|
||||
@@ -1,14 +1,9 @@
|
||||
import wx
|
||||
from service.fit import Fit
|
||||
|
||||
import gui.mainFrame
|
||||
from gui import globalEvents as GE
|
||||
#from .helpers import ModuleInfoCache
|
||||
from eos.saveddata.module import Module, State
|
||||
import eos.db
|
||||
from logbook import Logger
|
||||
pyfalog = Logger(__name__)
|
||||
|
||||
|
||||
class FitToggleDroneCommand(wx.Command):
|
||||
""""
|
||||
from sFit.toggleDrone
|
||||
|
||||
@@ -1,14 +1,8 @@
|
||||
import wx
|
||||
from service.fit import Fit
|
||||
|
||||
import gui.mainFrame
|
||||
from gui import globalEvents as GE
|
||||
#from .helpers import ModuleInfoCache
|
||||
from eos.saveddata.module import Module, State
|
||||
import eos.db
|
||||
from logbook import Logger
|
||||
pyfalog = Logger(__name__)
|
||||
from eos.saveddata.implant import Implant
|
||||
|
||||
|
||||
class FitToggleFighterCommand(wx.Command):
|
||||
""""
|
||||
|
||||
@@ -1,14 +1,8 @@
|
||||
import wx
|
||||
from service.fit import Fit
|
||||
|
||||
import gui.mainFrame
|
||||
from gui import globalEvents as GE
|
||||
#from .helpers import ModuleInfoCache
|
||||
from eos.saveddata.module import Module, State
|
||||
import eos.db
|
||||
from logbook import Logger
|
||||
pyfalog = Logger(__name__)
|
||||
from eos.saveddata.implant import Implant
|
||||
|
||||
|
||||
class FitToggleImplantCommand(wx.Command):
|
||||
""""
|
||||
|
||||
@@ -5,6 +5,7 @@ import gui.mainFrame
|
||||
from gui import globalEvents as GE
|
||||
from .calc.fitAddBooster import FitAddBoosterCommand
|
||||
|
||||
|
||||
class GuiAddBoosterCommand(wx.Command):
|
||||
def __init__(self, fitID, itemID):
|
||||
wx.Command.__init__(self, True, "Booster Add")
|
||||
@@ -27,4 +28,3 @@ class GuiAddBoosterCommand(wx.Command):
|
||||
self.sFit.recalc(self.fitID)
|
||||
wx.PostEvent(self.mainFrame, GE.FitChanged(fitID=self.fitID))
|
||||
return True
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ import gui.mainFrame
|
||||
from gui import globalEvents as GE
|
||||
from .calc.fitAddCargo import FitAddCargoCommand
|
||||
|
||||
|
||||
class GuiAddCargoCommand(wx.Command):
|
||||
def __init__(self, fitID, itemID, amount=1, replace=False):
|
||||
wx.Command.__init__(self, True, "Cargo Add")
|
||||
@@ -27,4 +28,3 @@ class GuiAddCargoCommand(wx.Command):
|
||||
self.internal_history.Undo()
|
||||
wx.PostEvent(self.mainFrame, GE.FitChanged(fitID=self.fitID))
|
||||
return True
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ import gui.mainFrame
|
||||
from gui import globalEvents as GE
|
||||
from .calc.fitSetCharge import FitSetChargeCommand
|
||||
|
||||
|
||||
class GuiModuleAddChargeCommand(wx.Command):
|
||||
def __init__(self, fitID, itemID, modules):
|
||||
wx.Command.__init__(self, True, "Module Charge Add")
|
||||
@@ -28,4 +29,3 @@ class GuiModuleAddChargeCommand(wx.Command):
|
||||
self.sFit.recalc(self.fitID)
|
||||
wx.PostEvent(self.mainFrame, GE.FitChanged(fitID=self.fitID))
|
||||
return True
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ import gui.mainFrame
|
||||
from gui import globalEvents as GE
|
||||
from .calc.fitAddCommand import FitAddCommandCommand
|
||||
|
||||
|
||||
class GuiAddCommandCommand(wx.Command):
|
||||
def __init__(self, fitID, commandFitID):
|
||||
wx.Command.__init__(self, True, "")
|
||||
@@ -27,4 +28,3 @@ class GuiAddCommandCommand(wx.Command):
|
||||
self.sFit.recalc(self.fitID)
|
||||
wx.PostEvent(self.mainFrame, GE.FitChanged(fitID=self.fitID))
|
||||
return True
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ import gui.mainFrame
|
||||
from gui import globalEvents as GE
|
||||
from .calc.fitAddDrone import FitAddDroneCommand
|
||||
|
||||
|
||||
class GuiAddDroneCommand(wx.Command):
|
||||
def __init__(self, fitID, itemID):
|
||||
wx.Command.__init__(self, True, "Cargo Add")
|
||||
@@ -27,4 +28,3 @@ class GuiAddDroneCommand(wx.Command):
|
||||
self.internal_history.Undo()
|
||||
wx.PostEvent(self.mainFrame, GE.FitChanged(fitID=self.fitID))
|
||||
return True
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ import gui.mainFrame
|
||||
from gui import globalEvents as GE
|
||||
from .calc.fitAddFighter import FitAddFighterCommand
|
||||
|
||||
|
||||
class GuiAddFighterCommand(wx.Command):
|
||||
def __init__(self, fitID, itemID):
|
||||
wx.Command.__init__(self, True, "Cargo Add")
|
||||
@@ -27,4 +28,3 @@ class GuiAddFighterCommand(wx.Command):
|
||||
self.sFit.recalc(self.fitID)
|
||||
wx.PostEvent(self.mainFrame, GE.FitChanged(fitID=self.fitID))
|
||||
return True
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ import gui.mainFrame
|
||||
from gui import globalEvents as GE
|
||||
from .calc.fitAddImplant import FitAddImplantCommand
|
||||
|
||||
|
||||
class GuiAddImplantCommand(wx.Command):
|
||||
def __init__(self, fitID, itemID):
|
||||
wx.Command.__init__(self, True, "Implant Add")
|
||||
@@ -27,4 +28,3 @@ class GuiAddImplantCommand(wx.Command):
|
||||
self.sFit.recalc(self.fitID)
|
||||
wx.PostEvent(self.mainFrame, GE.FitChanged(fitID=self.fitID))
|
||||
return True
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import wx
|
||||
import eos.db
|
||||
import gui.mainFrame
|
||||
from service.fit import Fit
|
||||
from gui import globalEvents as GE
|
||||
from .calc.fitAddModule import FitAddModuleCommand
|
||||
from .calc.fitReplaceModule import FitReplaceModuleCommand
|
||||
@@ -60,7 +59,6 @@ class GuiModuleAddCommand(wx.Command):
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
def Undo(self):
|
||||
pyfalog.debug("{} Undo()".format(self))
|
||||
for _ in self.internal_history.Commands:
|
||||
|
||||
@@ -54,4 +54,3 @@ class GuiAddProjectedCommand(wx.Command):
|
||||
self.sFit.recalc(self.fitID)
|
||||
wx.PostEvent(self.mainFrame, GE.FitChanged(fitID=self.fitID))
|
||||
return True
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ from .calc.fitAddCargo import FitAddCargoCommand
|
||||
from logbook import Logger
|
||||
pyfalog = Logger(__name__)
|
||||
|
||||
|
||||
class GuiCargoToModuleCommand(wx.Command):
|
||||
"""
|
||||
Moves cargo to fitting window. Can either do a copy, move, or swap with current module
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
import wx
|
||||
import eos.db
|
||||
import gui.mainFrame
|
||||
from service.fit import Fit
|
||||
from gui import globalEvents as GE
|
||||
from .calc.fitAddModule import FitAddModuleCommand
|
||||
from .calc.fitReplaceModule import FitReplaceModuleCommand
|
||||
from .calc.fitChangeCargoQty import FitChangeCargoQty
|
||||
from service.fit import Fit
|
||||
from logbook import Logger
|
||||
@@ -29,7 +25,6 @@ class GuiChangeCargoQty(wx.Command):
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
def Undo(self):
|
||||
for _ in self.internal_history.Commands:
|
||||
self.internal_history.Undo()
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
import wx
|
||||
import eos.db
|
||||
import gui.mainFrame
|
||||
from service.fit import Fit
|
||||
from gui import globalEvents as GE
|
||||
from .calc.fitAddModule import FitAddModuleCommand
|
||||
from .calc.fitReplaceModule import FitReplaceModuleCommand
|
||||
from .calc.fitChangeDroneQty import FitChangeDroneQty
|
||||
from service.fit import Fit
|
||||
from logbook import Logger
|
||||
@@ -29,7 +25,6 @@ class GuiChangeDroneQty(wx.Command):
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
def Undo(self):
|
||||
for _ in self.internal_history.Commands:
|
||||
self.internal_history.Undo()
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
import wx
|
||||
import eos.db
|
||||
import gui.mainFrame
|
||||
from service.fit import Fit
|
||||
from gui import globalEvents as GE
|
||||
from .calc.fitAddModule import FitAddModuleCommand
|
||||
from .calc.fitReplaceModule import FitReplaceModuleCommand
|
||||
from .calc.fitChangeFighterQty import FitChangeFighterQty
|
||||
from service.fit import Fit
|
||||
from logbook import Logger
|
||||
@@ -29,7 +25,6 @@ class GuiChangeFighterQty(wx.Command):
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
def Undo(self):
|
||||
pyfalog.debug("{} Undo()".format(self))
|
||||
for _ in self.internal_history.Commands:
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
import wx
|
||||
import eos.db
|
||||
import gui.mainFrame
|
||||
from service.fit import Fit
|
||||
from gui import globalEvents as GE
|
||||
from .calc.fitAddModule import FitAddModuleCommand
|
||||
from .calc.fitReplaceModule import FitReplaceModuleCommand
|
||||
from .calc.fitChangeProjectedDroneQty import FitChangeProjectedDroneQty
|
||||
from service.fit import Fit
|
||||
from logbook import Logger
|
||||
@@ -29,7 +25,6 @@ class GuiChangeProjectedDroneQty(wx.Command):
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
def Undo(self):
|
||||
pyfalog.debug("{} Undo()".format(self))
|
||||
for _ in self.internal_history.Commands:
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
import wx
|
||||
import eos.db
|
||||
import gui.mainFrame
|
||||
from service.fit import Fit
|
||||
from gui import globalEvents as GE
|
||||
from .calc.fitAddModule import FitAddModuleCommand
|
||||
from .calc.fitReplaceModule import FitReplaceModuleCommand
|
||||
from .calc.fitChangeProjectedFitQty import FitChangeProjectedFitQty
|
||||
from service.fit import Fit
|
||||
from logbook import Logger
|
||||
@@ -29,7 +25,6 @@ class GuiChangeProjectedFitQty(wx.Command):
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
def Undo(self):
|
||||
pyfalog.debug("{} Undo()".format(self))
|
||||
for _ in self.internal_history.Commands:
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
import wx
|
||||
import eos.db
|
||||
import gui.mainFrame
|
||||
from service.fit import Fit
|
||||
from gui import globalEvents as GE
|
||||
from .calc.fitRename import FitRenameCommand
|
||||
from service.fit import Fit
|
||||
from logbook import Logger
|
||||
@@ -25,7 +22,6 @@ class GuiFitRenameCommand(wx.Command):
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
def Undo(self):
|
||||
pyfalog.debug("{} Undo()".format(self))
|
||||
for _ in self.internal_history.Commands:
|
||||
|
||||
@@ -61,4 +61,3 @@ class GuiMetaSwapCommand(wx.Command):
|
||||
self.sFit.recalc(self.fitID)
|
||||
wx.PostEvent(self.mainFrame, GE.FitChanged(fitID=self.fitID))
|
||||
return True
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@ from .calc.fitAddCargo import FitAddCargoCommand
|
||||
from logbook import Logger
|
||||
pyfalog = Logger(__name__)
|
||||
|
||||
|
||||
class GuiModuleToCargoCommand(wx.Command):
|
||||
def __init__(self, fitID, moduleIdx, cargoIdx, copy=False):
|
||||
wx.Command.__init__(self, True, "Module State Change")
|
||||
@@ -31,7 +32,8 @@ class GuiModuleToCargoCommand(wx.Command):
|
||||
|
||||
if self.cargoIdx: # we're swapping with cargo
|
||||
if self.copy: # if copying, simply add item to cargo
|
||||
result = self.internal_history.Submit(FitAddCargoCommand(self.mainFrame.getActiveFit(), module.item.ID if not module.item.isAbyssal else module.baseItemID))
|
||||
result = self.internal_history.Submit(FitAddCargoCommand(
|
||||
self.mainFrame.getActiveFit(), module.item.ID if not module.item.isAbyssal else module.baseItemID))
|
||||
else: # otherwise, try to swap by replacing module with cargo item. If successful, remove old cargo and add new cargo
|
||||
|
||||
cargo = fit.cargo[self.cargoIdx]
|
||||
|
||||
@@ -5,6 +5,7 @@ import gui.mainFrame
|
||||
from gui import globalEvents as GE
|
||||
from .calc.fitRemoveBooster import FitRemoveBoosterCommand
|
||||
|
||||
|
||||
class GuiRemoveBoosterCommand(wx.Command):
|
||||
def __init__(self, fitID, position):
|
||||
wx.Command.__init__(self, True, "")
|
||||
@@ -27,4 +28,3 @@ class GuiRemoveBoosterCommand(wx.Command):
|
||||
self.sFit.recalc(self.fitID)
|
||||
wx.PostEvent(self.mainFrame, GE.FitChanged(fitID=self.fitID))
|
||||
return True
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ import gui.mainFrame
|
||||
from gui import globalEvents as GE
|
||||
from .calc.fitRemoveCargo import FitRemoveCargoCommand
|
||||
|
||||
|
||||
class GuiRemoveCargoCommand(wx.Command):
|
||||
def __init__(self, fitID, itemID):
|
||||
wx.Command.__init__(self, True, "Module Charge Add")
|
||||
@@ -25,4 +26,3 @@ class GuiRemoveCargoCommand(wx.Command):
|
||||
self.internal_history.Undo()
|
||||
wx.PostEvent(self.mainFrame, GE.FitChanged(fitID=self.fitID))
|
||||
return True
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ import gui.mainFrame
|
||||
from gui import globalEvents as GE
|
||||
from .calc.fitRemoveCommand import FitRemoveCommandCommand
|
||||
|
||||
|
||||
class GuiRemoveCommandCommand(wx.Command):
|
||||
def __init__(self, fitID, commandFitID):
|
||||
wx.Command.__init__(self, True, "")
|
||||
@@ -27,4 +28,3 @@ class GuiRemoveCommandCommand(wx.Command):
|
||||
self.sFit.recalc(self.fitID)
|
||||
wx.PostEvent(self.mainFrame, GE.FitChanged(fitID=self.fitID))
|
||||
return True
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ import gui.mainFrame
|
||||
from gui import globalEvents as GE
|
||||
from .calc.fitRemoveDrone import FitRemoveDroneCommand
|
||||
|
||||
|
||||
class GuiRemoveDroneCommand(wx.Command):
|
||||
def __init__(self, fitID, position, amount=1):
|
||||
wx.Command.__init__(self, True, "Cargo Add")
|
||||
@@ -28,4 +29,3 @@ class GuiRemoveDroneCommand(wx.Command):
|
||||
self.internal_history.Undo()
|
||||
wx.PostEvent(self.mainFrame, GE.FitChanged(fitID=self.fitID))
|
||||
return True
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ import gui.mainFrame
|
||||
from gui import globalEvents as GE
|
||||
from .calc.fitRemoveImplant import FitRemoveImplantCommand
|
||||
|
||||
|
||||
class GuiRemoveImplantCommand(wx.Command):
|
||||
def __init__(self, fitID, position):
|
||||
wx.Command.__init__(self, True, "")
|
||||
@@ -25,4 +26,3 @@ class GuiRemoveImplantCommand(wx.Command):
|
||||
self.internal_history.Undo()
|
||||
wx.PostEvent(self.mainFrame, GE.FitChanged(fitID=self.fitID))
|
||||
return True
|
||||
|
||||
|
||||
@@ -19,7 +19,8 @@ class GuiModuleRemoveCommand(wx.Command):
|
||||
self.mainFrame = gui.mainFrame.MainFrame.getInstance()
|
||||
self.sFit = Fit.getInstance()
|
||||
self.fitID = fitID
|
||||
self.modCache = [ModuleInfoCache(mod.modPosition, mod.item.ID, mod.state, mod.charge, mod.baseItemID, mod.mutaplasmidID) for mod in modules if not mod.isEmpty]
|
||||
self.modCache = [ModuleInfoCache(
|
||||
mod.modPosition, mod.item.ID, mod.state, mod.charge, mod.baseItemID, mod.mutaplasmidID) for mod in modules if not mod.isEmpty]
|
||||
self.internal_history = wx.CommandProcessor()
|
||||
|
||||
def Do(self):
|
||||
|
||||
@@ -3,20 +3,19 @@ from service.fit import Fit
|
||||
|
||||
import gui.mainFrame
|
||||
from gui import globalEvents as GE
|
||||
from eos.saveddata.module import Module
|
||||
from .calc.fitRemoveProjectedModule import FitRemoveProjectedModuleCommand
|
||||
from .calc.fitRemoveProjectedEnv import FitRemoveProjectedEnvCommand
|
||||
from .calc.fitRemoveProjectedFit import FitRemoveProjectedFitCommand
|
||||
from .calc.fitRemoveProjectedFighter import FitRemoveProjectedFighterCommand
|
||||
from logbook import Logger
|
||||
from .calc.fitRemoveProjectedDrone import FitRemoveProjectedDroneCommand
|
||||
pyfalog = Logger(__name__)
|
||||
import eos.db
|
||||
|
||||
from eos.saveddata.drone import Drone
|
||||
from eos.saveddata.module import Module
|
||||
from eos.saveddata.fighter import Fighter
|
||||
|
||||
pyfalog = Logger(__name__)
|
||||
|
||||
|
||||
class GuiRemoveProjectedCommand(wx.Command):
|
||||
mapping = {
|
||||
@@ -88,4 +87,3 @@ class GuiRemoveProjectedCommand(wx.Command):
|
||||
self.sFit.recalc(self.fitID)
|
||||
wx.PostEvent(self.mainFrame, GE.FitChanged(fitID=self.fitID))
|
||||
return True
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ import gui.mainFrame
|
||||
from gui import globalEvents as GE
|
||||
from .calc.fitSetMode import FitSetModeCommand
|
||||
|
||||
|
||||
class GuiSetModeCommand(wx.Command):
|
||||
def __init__(self, fitID, mode):
|
||||
wx.Command.__init__(self, True, "Cargo Add")
|
||||
@@ -27,4 +28,3 @@ class GuiSetModeCommand(wx.Command):
|
||||
self.sFit.recalc(self.fitID)
|
||||
wx.PostEvent(self.mainFrame, GE.FitChanged(fitID=self.fitID))
|
||||
return True
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ import gui.mainFrame
|
||||
from gui import globalEvents as GE
|
||||
from .calc.fitToggleBooster import FitToggleBoosterCommand
|
||||
|
||||
|
||||
class GuiToggleBoosterCommand(wx.Command):
|
||||
def __init__(self, fitID, position):
|
||||
wx.Command.__init__(self, True, "")
|
||||
@@ -27,4 +28,3 @@ class GuiToggleBoosterCommand(wx.Command):
|
||||
self.sFit.recalc(self.fitID)
|
||||
wx.PostEvent(self.mainFrame, GE.FitChanged(fitID=self.fitID))
|
||||
return True
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ import gui.mainFrame
|
||||
from gui import globalEvents as GE
|
||||
from .calc.fitToggleCommand import FitToggleCommandCommand
|
||||
|
||||
|
||||
class GuiToggleCommandCommand(wx.Command):
|
||||
def __init__(self, fitID, commandFitID):
|
||||
wx.Command.__init__(self, True, "")
|
||||
@@ -27,4 +28,3 @@ class GuiToggleCommandCommand(wx.Command):
|
||||
self.sFit.recalc(self.fitID)
|
||||
wx.PostEvent(self.mainFrame, GE.FitChanged(fitID=self.fitID))
|
||||
return True
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ import gui.mainFrame
|
||||
from gui import globalEvents as GE
|
||||
from .calc.fitToggleDrone import FitToggleDroneCommand
|
||||
|
||||
|
||||
class GuiToggleDroneCommand(wx.Command):
|
||||
def __init__(self, fitID, position):
|
||||
wx.Command.__init__(self, True, "")
|
||||
@@ -27,4 +28,3 @@ class GuiToggleDroneCommand(wx.Command):
|
||||
self.sFit.recalc(self.fitID)
|
||||
wx.PostEvent(self.mainFrame, GE.FitChanged(fitID=self.fitID))
|
||||
return True
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ import gui.mainFrame
|
||||
from gui import globalEvents as GE
|
||||
from .calc.fitToggleFighter import FitToggleFighterCommand
|
||||
|
||||
|
||||
class GuiToggleFighterCommand(wx.Command):
|
||||
def __init__(self, fitID, position):
|
||||
wx.Command.__init__(self, True, "")
|
||||
@@ -27,4 +28,3 @@ class GuiToggleFighterCommand(wx.Command):
|
||||
self.sFit.recalc(self.fitID)
|
||||
wx.PostEvent(self.mainFrame, GE.FitChanged(fitID=self.fitID))
|
||||
return True
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ import gui.mainFrame
|
||||
from gui import globalEvents as GE
|
||||
from .calc.fitToggleImplant import FitToggleImplantCommand
|
||||
|
||||
|
||||
class GuiToggleImplantCommand(wx.Command):
|
||||
def __init__(self, fitID, position):
|
||||
wx.Command.__init__(self, True, "")
|
||||
@@ -27,4 +28,3 @@ class GuiToggleImplantCommand(wx.Command):
|
||||
self.sFit.recalc(self.fitID)
|
||||
wx.PostEvent(self.mainFrame, GE.FitChanged(fitID=self.fitID))
|
||||
return True
|
||||
|
||||
|
||||
@@ -31,4 +31,3 @@ class GuiModuleStateChangeCommand(wx.Command):
|
||||
self.sFit.recalc(self.fitID)
|
||||
wx.PostEvent(self.mainFrame, GE.FitChanged(fitID=self.fitID))
|
||||
return True
|
||||
|
||||
|
||||
@@ -39,10 +39,10 @@ from service.damagePattern import DamagePattern
|
||||
from service.settings import SettingsProvider
|
||||
from utils.deprecated import deprecated
|
||||
import wx
|
||||
from service.fitDeprecated import FitDeprecated
|
||||
|
||||
pyfalog = Logger(__name__)
|
||||
|
||||
from service.fitDeprecated import FitDeprecated
|
||||
|
||||
class DeferRecalc():
|
||||
def __init__(self, fitID):
|
||||
@@ -359,9 +359,6 @@ class Fit(FitDeprecated):
|
||||
eos.db.commit()
|
||||
self.recalc(fit)
|
||||
|
||||
|
||||
|
||||
|
||||
def changeMutatedValue(self, mutator, value):
|
||||
pyfalog.debug("Changing mutated value for {} / {}: {} => {}".format(mutator.module, mutator.module.mutaplasmid, mutator.value, value))
|
||||
mutator.value = value
|
||||
|
||||
@@ -44,7 +44,7 @@ class FitDeprecated(object):
|
||||
old_name = fit.name
|
||||
fit.name = newName
|
||||
eos.db.commit()
|
||||
return old_name, newName
|
||||
return old_name, newName
|
||||
|
||||
@deprecated
|
||||
def toggleDrone(self, fitID, i):
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import warnings
|
||||
import functools
|
||||
|
||||
|
||||
def deprecated(func):
|
||||
"""This is a decorator which can be used to mark functions
|
||||
as deprecated. It will result in a warning being emitted
|
||||
|
||||
Reference in New Issue
Block a user