def execute(self, cmd):
        """Execute a command to modify storage[cmd.filePath]"""
        if not cmd.filePath in self._history.keys():
            self._history[cmd.filePath] = SubtitleUndoStack(self)
            try:
                self._history[cmd.filePath].push(cmd)
            except:
                self._history[cmd.filePath].deleteLater()
                del self._history[cmd.filePath]
                raise
            else:
                self._history[cmd.filePath].clear()
        else:
            self._history[cmd.filePath].push(cmd)
def execute ( self , cmd ) : if not cmd . filePath in self . _history . keys ( ) : self . _history [ cmd . filePath ] = SubtitleUndoStack ( self ) try : self . _history [ cmd . filePath ] . push ( cmd ) except : self . _history [ cmd . filePath ] . deleteLater ( ) del self . _history [ cmd . filePath ] raise else : self . _history [ cmd . filePath ] . clear ( ) else : self . _history [ cmd . filePath ] . push ( cmd )
Execute a command to modify storage[cmd.filePath]