Undo action.
(
file_: "File",
operation: Literal["ADDATTR", "CREATE", "DELATTR", "MOVE", "REMOVE"],
*args: str,
)
| 28 | |
| 29 | |
| 30 | def undo( |
| 31 | file_: "File", |
| 32 | operation: Literal["ADDATTR", "CREATE", "DELATTR", "MOVE", "REMOVE"], |
| 33 | *args: str, |
| 34 | ) -> None: |
| 35 | """Undo action.""" |
| 36 | if operation == "CREATE": |
| 37 | undo_create(file_, args[0]) |
| 38 | elif operation == "REMOVE": |
| 39 | undo_remove(file_, args[0]) |
| 40 | elif operation == "MOVE": |
| 41 | undo_move(file_, args[0], args[1]) |
| 42 | elif operation == "ADDATTR": |
| 43 | undo_add_attr(file_, args[0], args[1]) |
| 44 | elif operation == "DELATTR": |
| 45 | undo_del_attr(file_, args[0], args[1]) |
| 46 | else: |
| 47 | raise NotImplementedError( |
| 48 | "the requested unknown operation %r can " |
| 49 | "not be undone; please report this to the " |
| 50 | "authors" % operation |
| 51 | ) |
| 52 | |
| 53 | |
| 54 | def redo( |
nothing calls this directly
no test coverage detected