Merge branch 'master' into singularity
This commit is contained in:
@@ -2,7 +2,6 @@ import wx
|
||||
from logbook import Logger
|
||||
|
||||
import eos.db
|
||||
from eos.exception import HandledListActionError
|
||||
from service.fit import Fit
|
||||
|
||||
|
||||
@@ -35,9 +34,8 @@ class CalcAddBoosterCommand(wx.Command):
|
||||
self.oldPosition, self.oldBoosterInfo = fit.boosters.makeRoom(newBooster)
|
||||
|
||||
if self.newPosition is not None:
|
||||
try:
|
||||
fit.boosters.insert(self.newPosition, newBooster, raiseFailure=True)
|
||||
except HandledListActionError:
|
||||
fit.boosters.insert(self.newPosition, newBooster)
|
||||
if newBooster not in fit.boosters:
|
||||
pyfalog.warning('Failed to insert to list')
|
||||
cmd = CalcAddBoosterCommand(
|
||||
fitID=self.fitID,
|
||||
@@ -47,9 +45,8 @@ class CalcAddBoosterCommand(wx.Command):
|
||||
cmd.Do()
|
||||
return False
|
||||
else:
|
||||
try:
|
||||
fit.boosters.append(newBooster, raiseFailure=True)
|
||||
except HandledListActionError:
|
||||
fit.boosters.append(newBooster)
|
||||
if newBooster not in fit.boosters:
|
||||
pyfalog.warning('Failed to append to list')
|
||||
cmd = CalcAddBoosterCommand(
|
||||
fitID=self.fitID,
|
||||
|
||||
@@ -2,7 +2,6 @@ import wx
|
||||
from logbook import Logger
|
||||
|
||||
import eos.db
|
||||
from eos.exception import HandledListActionError
|
||||
from service.fit import Fit
|
||||
|
||||
|
||||
@@ -25,9 +24,8 @@ class CalcAddCargoCommand(wx.Command):
|
||||
cargo.amount += self.cargoInfo.amount
|
||||
else:
|
||||
cargo = self.cargoInfo.toCargo()
|
||||
try:
|
||||
fit.cargo.append(cargo, raiseFailure=True)
|
||||
except HandledListActionError:
|
||||
fit.cargo.append(cargo)
|
||||
if cargo not in fit.cargo:
|
||||
pyfalog.warning('Failed to append to list')
|
||||
if self.commit:
|
||||
eos.db.commit()
|
||||
|
||||
@@ -3,7 +3,6 @@ import wx
|
||||
from logbook import Logger
|
||||
|
||||
import eos.db
|
||||
from eos.exception import HandledListActionError
|
||||
from gui.fitCommands.helpers import DroneInfo, droneStackLimit
|
||||
from service.fit import Fit
|
||||
from service.market import Market
|
||||
@@ -50,9 +49,8 @@ class CalcAddLocalDroneCommand(wx.Command):
|
||||
if not self.ignoreRestrictions and not drone.fits(fit):
|
||||
pyfalog.warning('Drone does not fit')
|
||||
return False
|
||||
try:
|
||||
fit.drones.append(drone, raiseFailure=True)
|
||||
except HandledListActionError:
|
||||
fit.drones.append(drone)
|
||||
if drone not in fit.drones:
|
||||
pyfalog.warning('Failed to append to list')
|
||||
if self.commit:
|
||||
eos.db.commit()
|
||||
|
||||
@@ -2,7 +2,6 @@ import wx
|
||||
from logbook import Logger
|
||||
|
||||
import eos.db
|
||||
from eos.exception import HandledListActionError
|
||||
from gui.fitCommands.helpers import DroneInfo
|
||||
from service.fit import Fit
|
||||
|
||||
@@ -48,9 +47,8 @@ class CalcRemoveLocalDroneCommand(wx.Command):
|
||||
drone = self.savedDroneInfo.toDrone()
|
||||
if drone is None:
|
||||
return False
|
||||
try:
|
||||
fit.drones.insert(self.position, drone, raiseFailure=True)
|
||||
except HandledListActionError:
|
||||
fit.drones.insert(self.position, drone)
|
||||
if drone not in fit.drones:
|
||||
pyfalog.warning('Failed to insert to list')
|
||||
if self.commit:
|
||||
eos.db.commit()
|
||||
|
||||
@@ -4,7 +4,6 @@ import wx
|
||||
from logbook import Logger
|
||||
|
||||
import eos.db
|
||||
from eos.exception import HandledListActionError
|
||||
from gui.fitCommands.helpers import DroneInfo
|
||||
from service.fit import Fit
|
||||
|
||||
@@ -43,9 +42,8 @@ class CalcAddProjectedDroneCommand(wx.Command):
|
||||
if not drone.item.isType('projected'):
|
||||
pyfalog.debug('Drone is not projectable')
|
||||
return False
|
||||
try:
|
||||
fit.projectedDrones.append(drone, raiseFailure=True)
|
||||
except HandledListActionError:
|
||||
fit.projectedDrones.append(drone)
|
||||
if drone not in fit.projectedDrones:
|
||||
pyfalog.warning('Failed to append to list')
|
||||
if self.commit:
|
||||
eos.db.commit()
|
||||
|
||||
@@ -2,7 +2,6 @@ import wx
|
||||
from logbook import Logger
|
||||
|
||||
import eos.db
|
||||
from eos.exception import HandledListActionError
|
||||
from service.fit import Fit
|
||||
|
||||
|
||||
@@ -41,18 +40,16 @@ class CalcAddLocalFighterCommand(wx.Command):
|
||||
fighter.active = True
|
||||
|
||||
if self.position is None:
|
||||
try:
|
||||
fit.fighters.append(fighter, raiseFailure=True)
|
||||
except HandledListActionError:
|
||||
fit.fighters.append(fighter)
|
||||
if fighter not in fit.fighters:
|
||||
pyfalog.warning('Failed to append to list')
|
||||
if self.commit:
|
||||
eos.db.commit()
|
||||
return False
|
||||
self.position = fit.fighters.index(fighter)
|
||||
else:
|
||||
try:
|
||||
fit.fighters.insert(self.position, fighter, raiseFailure=True)
|
||||
except HandledListActionError:
|
||||
fit.fighters.insert(self.position, fighter)
|
||||
if fighter not in fit.fighters:
|
||||
pyfalog.warning('Failed to insert to list')
|
||||
if self.commit:
|
||||
eos.db.commit()
|
||||
|
||||
@@ -2,7 +2,6 @@ import wx
|
||||
from logbook import Logger
|
||||
|
||||
import eos.db
|
||||
from eos.exception import HandledListActionError
|
||||
from service.fit import Fit
|
||||
|
||||
|
||||
@@ -25,16 +24,14 @@ class CalcAddProjectedFighterCommand(wx.Command):
|
||||
return False
|
||||
fit = Fit.getInstance().getFit(self.fitID)
|
||||
if self.position is not None:
|
||||
try:
|
||||
fit.projectedFighters.insert(self.position, fighter, raiseFailure=True)
|
||||
except HandledListActionError:
|
||||
fit.projectedFighters.insert(self.position, fighter)
|
||||
if fighter not in fit.projectedFighters:
|
||||
if self.commit:
|
||||
eos.db.commit()
|
||||
return False
|
||||
else:
|
||||
try:
|
||||
fit.projectedFighters.append(fighter, raiseFailure=True)
|
||||
except HandledListActionError:
|
||||
fit.projectedFighters.append(fighter)
|
||||
if fighter not in fit.projectedFighters:
|
||||
if self.commit:
|
||||
eos.db.commit()
|
||||
return False
|
||||
|
||||
@@ -2,7 +2,6 @@ import wx
|
||||
from logbook import Logger
|
||||
|
||||
import eos.db
|
||||
from eos.exception import HandledListActionError
|
||||
from service.fit import Fit
|
||||
|
||||
|
||||
@@ -35,9 +34,8 @@ class CalcAddImplantCommand(wx.Command):
|
||||
self.oldPosition, self.oldImplantInfo = fit.implants.makeRoom(newImplant)
|
||||
|
||||
if self.newPosition is not None:
|
||||
try:
|
||||
fit.implants.insert(self.newPosition, newImplant, raiseFailure=True)
|
||||
except HandledListActionError:
|
||||
fit.implants.insert(self.newPosition, newImplant)
|
||||
if newImplant not in fit.implants:
|
||||
pyfalog.warning('Failed to insert to list')
|
||||
cmd = CalcAddImplantCommand(
|
||||
fitID=self.fitID,
|
||||
@@ -47,9 +45,8 @@ class CalcAddImplantCommand(wx.Command):
|
||||
cmd.Do()
|
||||
return False
|
||||
else:
|
||||
try:
|
||||
fit.implants.append(newImplant, raiseFailure=True)
|
||||
except HandledListActionError:
|
||||
fit.implants.append(newImplant)
|
||||
if newImplant not in fit.implants:
|
||||
pyfalog.warning('Failed to append to list')
|
||||
cmd = CalcAddImplantCommand(
|
||||
fitID=self.fitID,
|
||||
|
||||
@@ -2,7 +2,6 @@ import wx
|
||||
from logbook import Logger
|
||||
|
||||
import eos.db
|
||||
from eos.exception import HandledListActionError
|
||||
from gui.fitCommands.helpers import restoreCheckedStates, stateLimit
|
||||
from service.fit import Fit
|
||||
|
||||
@@ -55,9 +54,8 @@ class CalcAddLocalModuleCommand(wx.Command):
|
||||
if not newMod.fits(fit):
|
||||
pyfalog.warning('Module does not fit')
|
||||
return False
|
||||
try:
|
||||
fit.modules.append(newMod, raiseFailure=True)
|
||||
except HandledListActionError:
|
||||
fit.modules.append(newMod)
|
||||
if newMod not in fit.modules:
|
||||
pyfalog.warning('Failed to append to list')
|
||||
if self.commit:
|
||||
eos.db.commit()
|
||||
|
||||
@@ -4,7 +4,6 @@ import wx
|
||||
from logbook import Logger
|
||||
|
||||
import eos.db
|
||||
from eos.exception import HandledListActionError
|
||||
from gui.fitCommands.helpers import restoreCheckedStates
|
||||
from service.fit import Fit
|
||||
|
||||
@@ -31,9 +30,8 @@ class CalcCloneLocalModuleCommand(wx.Command):
|
||||
return False
|
||||
if not fit.modules[self.dstPosition].isEmpty:
|
||||
return False
|
||||
try:
|
||||
fit.modules.replace(self.dstPosition, copyMod, raiseFailure=True)
|
||||
except HandledListActionError:
|
||||
fit.modules.replace(self.dstPosition, copyMod)
|
||||
if copyMod not in fit.modules:
|
||||
pyfalog.warning('Failed to replace module')
|
||||
eos.db.commit()
|
||||
return False
|
||||
|
||||
@@ -2,7 +2,6 @@ import wx
|
||||
from logbook import Logger
|
||||
|
||||
import eos.db
|
||||
from eos.exception import HandledListActionError
|
||||
from gui.fitCommands.helpers import ModuleInfo, restoreCheckedStates, stateLimit
|
||||
from service.fit import Fit
|
||||
|
||||
@@ -53,9 +52,8 @@ class CalcReplaceLocalModuleCommand(wx.Command):
|
||||
pyfalog.warning('Invalid charge')
|
||||
self.Undo()
|
||||
return False
|
||||
try:
|
||||
fit.modules.replace(self.position, newMod, raiseFailure=True)
|
||||
except HandledListActionError:
|
||||
fit.modules.replace(self.position, newMod)
|
||||
if newMod not in fit.modules:
|
||||
pyfalog.warning('Failed to replace in list')
|
||||
self.Undo()
|
||||
return False
|
||||
@@ -87,9 +85,8 @@ class CalcReplaceLocalModuleCommand(wx.Command):
|
||||
if oldMod is None:
|
||||
return False
|
||||
fit.modules.free(self.position)
|
||||
try:
|
||||
fit.modules.replace(self.position, oldMod, raiseFailure=True)
|
||||
except HandledListActionError:
|
||||
fit.modules.replace(self.position, oldMod)
|
||||
if oldMod not in fit.modules:
|
||||
pyfalog.warning('Failed to replace in list')
|
||||
self.Do()
|
||||
return False
|
||||
|
||||
@@ -2,7 +2,6 @@ import wx
|
||||
from logbook import Logger
|
||||
|
||||
import eos.db
|
||||
from eos.exception import HandledListActionError
|
||||
from service.fit import Fit
|
||||
|
||||
|
||||
@@ -33,16 +32,14 @@ class CalcSwapLocalModuleCommand(wx.Command):
|
||||
mod2 = fit.modules[position2]
|
||||
fit.modules.free(position1)
|
||||
fit.modules.free(position2)
|
||||
try:
|
||||
fit.modules.replace(position2, mod1, raiseFailure=True)
|
||||
except HandledListActionError:
|
||||
fit.modules.replace(position2, mod1)
|
||||
if len(fit.modules) <= position2 or fit.modules[position2] is not mod1:
|
||||
fit.modules.replace(position1, mod1)
|
||||
fit.modules.replace(position2, mod2)
|
||||
eos.db.commit()
|
||||
return False
|
||||
try:
|
||||
fit.modules.replace(position1, mod2, raiseFailure=True)
|
||||
except HandledListActionError:
|
||||
fit.modules.replace(position1, mod2)
|
||||
if len(fit.modules) <= position1 or fit.modules[position1] is not mod2:
|
||||
fit.modules.free(position2)
|
||||
fit.modules.replace(position1, mod1)
|
||||
fit.modules.replace(position2, mod2)
|
||||
|
||||
@@ -3,7 +3,6 @@ from logbook import Logger
|
||||
|
||||
import eos.db
|
||||
from eos.const import FittingModuleState
|
||||
from eos.exception import HandledListActionError
|
||||
from gui.fitCommands.helpers import restoreCheckedStates
|
||||
from service.fit import Fit
|
||||
|
||||
@@ -39,16 +38,14 @@ class CalcAddProjectedModuleCommand(wx.Command):
|
||||
self.oldPosition, self.oldModInfo = fit.projectedModules.makeRoom(newMod)
|
||||
|
||||
if self.newPosition is not None:
|
||||
try:
|
||||
fit.projectedModules.insert(self.newPosition, newMod, raiseFailure=True)
|
||||
except HandledListActionError:
|
||||
fit.projectedModules.insert(self.newPosition, newMod)
|
||||
if newMod not in fit.projectedModules:
|
||||
if self.commit:
|
||||
eos.db.commit()
|
||||
return False
|
||||
else:
|
||||
try:
|
||||
fit.projectedModules.append(newMod, raiseFailure=True)
|
||||
except HandledListActionError:
|
||||
fit.projectedModules.append(newMod)
|
||||
if newMod not in fit.projectedModules:
|
||||
if self.commit:
|
||||
eos.db.commit()
|
||||
return False
|
||||
|
||||
Reference in New Issue
Block a user