[python27] fix compatibility issues

This commit is contained in:
Yann Lanthony 2017-10-06 15:45:39 +02:00
parent 2ba1278ee8
commit b8eff927cc
2 changed files with 8 additions and 5 deletions

View file

@ -21,10 +21,12 @@ class UndoCommand(QUndoCommand):
return
self.undoImpl()
def redoImpl(self) -> bool:
def redoImpl(self):
# type: () -> bool
pass
def undoImpl(self) -> bool:
def undoImpl(self):
# type: () -> bool
pass
@ -38,7 +40,8 @@ class UndoStack(QUndoStack):
self.undoTextChanged.connect(self._undoTextChanged)
self.redoTextChanged.connect(self._redoTextChanged)
def tryAndPush(self, command: UndoCommand):
def tryAndPush(self, command):
# type: (UndoCommand) -> bool
if command.redoImpl():
command.setEnabled(False)
self.push(command) # takes ownership