MCPcopy Index your code
hub / github.com/pyfa-org/Pyfa / undoAll

Method undoAll

gui/fitCommands/helpers.py:39–53  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

37 return True
38
39 def undoAll(self):
40 undoneCommands = []
41 # Undo commands one by one, starting from the last
42 for commandToUndo in reversed(self.__buffer.Commands):
43 if commandToUndo.Undo():
44 undoneCommands.append(commandToUndo)
45 # If undoing fails, redo already undone commands, starting from the last undone
46 else:
47 for commandToRedo in reversed(undoneCommands):
48 if not commandToRedo.Do():
49 break
50 self.__buffer.ClearCommands()
51 return False
52 self.__buffer.ClearCommands()
53 return True
54
55 def __len__(self):
56 return len(self.__buffer.Commands)

Callers 15

UndoMethod · 0.80
UndoMethod · 0.80
UndoMethod · 0.80
UndoMethod · 0.80
UndoMethod · 0.80
UndoMethod · 0.80
UndoMethod · 0.80
UndoMethod · 0.80
UndoMethod · 0.80
UndoMethod · 0.80
UndoMethod · 0.80
UndoMethod · 0.80

Calls 3

UndoMethod · 0.45
appendMethod · 0.45
DoMethod · 0.45

Tested by

no test coverage detected