Move the FitRenameCommand command

This commit is contained in:
blitzmann
2018-09-15 17:46:55 -04:00
parent 12b11d57ba
commit b08406b7d6
6 changed files with 77 additions and 31 deletions

View File

@@ -185,15 +185,6 @@ class Fit(FitDeprecated):
fit.booster = not fit.booster
eos.db.commit()
@staticmethod
def renameFit(fitID, newName):
pyfalog.debug("Renaming fit ({0}) to: {1}", fitID, newName)
fit = eos.db.getFit(fitID)
old_name = fit.name
fit.name = newName
eos.db.commit()
return old_name, newName
@staticmethod
def deleteFit(fitID):
fit = eos.db.getFit(fitID)

View File

@@ -36,6 +36,16 @@ pyfalog = Logger(__name__)
class FitDeprecated(object):
@staticmethod
@deprecated
def renameFit(fitID, newName):
pyfalog.debug("Renaming fit ({0}) to: {1}", fitID, newName)
fit = eos.db.getFit(fitID)
old_name = fit.name
fit.name = newName
eos.db.commit()
return old_name, newName
@deprecated
def toggleDrone(self, fitID, i):
pyfalog.debug("Toggling drones for fit ID: {0}", fitID)