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

Method goto

tables/file.py:2823–2844  ·  view source on GitHub ↗

Go to a specific mark of the database. Returns the database to the state associated with the specified mark. Both the identifier of a mark and its name can be used. This method can only be called when the Undo/Redo mechanism has been enabled. Otherwise, an UndoRedoE

(self, mark: int | str)

Source from the content-addressed store, hash-verified

2821 # (self._curaction, self._curmark))
2822
2823 def goto(self, mark: int | str) -> None:
2824 """Go to a specific mark of the database.
2825
2826 Returns the database to the state associated with the specified mark.
2827 Both the identifier of a mark and its name can be used.
2828
2829 This method can only be called when the Undo/Redo mechanism has been
2830 enabled. Otherwise, an UndoRedoError is raised.
2831
2832 """
2833 self._check_open()
2834 self._check_undo_enabled()
2835
2836 if mark == -1: # Special case
2837 mark = self._nmarks # Go beyond the mark bounds up to the end
2838 # Get the mark ID number
2839 markid = self._get_mark_id(mark)
2840 finalaction = self._get_final_action(markid)
2841 if finalaction < self._curaction:
2842 self.undo(mark)
2843 else:
2844 self.redo(mark)
2845
2846 def get_current_mark(self) -> int:
2847 """Get the identifier of the current mark.

Callers 4

test10_gotoMethod · 0.80
test10_gotointMethod · 0.80
test11_contiguousMethod · 0.80
tutorial3-2.pyFile · 0.80

Calls 6

_check_openMethod · 0.95
_check_undo_enabledMethod · 0.95
_get_mark_idMethod · 0.95
_get_final_actionMethod · 0.95
undoMethod · 0.95
redoMethod · 0.95

Tested by 3

test10_gotoMethod · 0.64
test10_gotointMethod · 0.64
test11_contiguousMethod · 0.64