(self)
| 16 | self.savedState = None |
| 17 | |
| 18 | def Do(self): |
| 19 | pyfalog.debug('Doing removal of command fit {} for fit {}'.format(self.commandFitID, self.fitID)) |
| 20 | sFit = Fit.getInstance() |
| 21 | fit = sFit.getFit(self.fitID) |
| 22 | commandFit = sFit.getFit(self.commandFitID) |
| 23 | |
| 24 | # Can be removed by the time we're redoing it |
| 25 | if commandFit is None: |
| 26 | pyfalog.debug('Command fit is not available') |
| 27 | return False |
| 28 | commandInfo = commandFit.getCommandInfo(self.fitID) |
| 29 | if commandInfo is None: |
| 30 | pyfalog.warning('Fit command info is not available') |
| 31 | return False |
| 32 | self.savedState = commandInfo.active |
| 33 | if commandFit.ID not in fit.commandFitDict: |
| 34 | pyfalog.warning('Unable to find commanding fit in command dict') |
| 35 | return False |
| 36 | del fit.commandFitDict[commandFit.ID] |
| 37 | return True |
| 38 | |
| 39 | def Undo(self): |
| 40 | pyfalog.debug('Undoing removal of command fit {} for fit {}'.format(self.commandFitID, self.fitID)) |
no test coverage detected