MCPcopy Create free account
hub / github.com/PyTables/PyTables / undo

Function undo

tables/undoredo.py:30–51  ·  view source on GitHub ↗

Undo action.

(
    file_: "File",
    operation: Literal["ADDATTR", "CREATE", "DELATTR", "MOVE", "REMOVE"],
    *args: str,
)

Source from the content-addressed store, hash-verified

28
29
30def 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
54def redo(

Callers

nothing calls this directly

Calls 5

undo_createFunction · 0.85
undo_removeFunction · 0.85
undo_moveFunction · 0.85
undo_add_attrFunction · 0.85
undo_del_attrFunction · 0.85

Tested by

no test coverage detected