collections_undo package¶
Submodules¶
collections_undo.abc module¶
- collections_undo.abc.UndoableABC[source]¶
alias of
collections_undo.abc.UndoableABC
collections_undo.containers module¶
Using UndoManager in a way similar to Python object.
- class collections_undo.containers.AbstractUndoableDict[source]¶
Bases:
MutableMapping[collections_undo._containers._dict._K,collections_undo._containers._dict._V]
- class collections_undo.containers.AbstractUndoableList[source]¶
Bases:
MutableSequence[collections_undo._containers._list._T]An undoable mutable sequence.
__getitem__(self, key) -> _T… Get item atkey. You must return a copy of the item if the item is mutable, such as a numpy array._raw_setitem(self, key, val) -> None… Set item atkey._raw_delitem(self, key) -> None… Delete item atkey._raw_insert(self, index, val)… Insertvalatindex.__len__(self) -> int… Get length of list.__iter__(self) -> Iterator… Iterate over list.
- extend(values: Iterable[collections_undo._containers._list._T]) None[source]¶
Extend the list with given values.
- class collections_undo.containers.AbstractUndoableSet[source]¶
Bases:
MutableSet[collections_undo._containers._set._T]
- class collections_undo.containers.UndoableDict(*args, **kwargs)[source]¶
Bases:
collections_undo._containers._dict.AbstractUndoableDict[collections_undo._containers._dict._K,collections_undo._containers._dict._V]
- class collections_undo.containers.UndoableList(iterable=(), /)[source]¶
Bases:
collections_undo._containers._list.AbstractUndoableList[collections_undo._containers._list._T]
- class collections_undo.containers.UndoableSet(iterable: Iterable[collections_undo._containers._set._T] = (), /)[source]¶
Bases:
collections_undo._containers._set.AbstractUndoableSet[collections_undo._containers._set._T]
collections_undo.fmt module¶
- collections_undo.fmt.get_formatter(func: Callable)¶
- collections_undo.fmt.map_object(value: collections_undo._formatter._T) str¶
Map object to string.
- collections_undo.fmt.register_type(formatter, type=None, *, overwrite: bool = False) Callable[[collections_undo._formatter._T], str]¶
Module contents¶
- class collections_undo.UndoManager(*, measure: Callable[..., float] = <function always_zero>, maxsize: float | Literal['inf'] = 'inf')[source]¶
Bases:
object- append(cmd: collections_undo._command._CommandBase) None[source]¶
Append new command to the undo stack.
- property called: collections_undo._stack_utils.CallbackList[Callable[[collections_undo._command._CommandBase, collections_undo._stack_utils.CallType], Any]]¶
Callback list for called events.
- property empty: bool¶
True if stack is empty.
- property errored: collections_undo._stack_utils.CallbackList[Callable[[collections_undo._command._CommandBase, Exception], Any]]¶
Callback list for errored events.
- interface(func: Callable[_P, _R], name: str | None = None) UndoableInterface[_P, _R, Any][source]¶
- interface(func: Literal[None], name: str | None = None) Callable[[Callable[_P, _R]], UndoableInterface[_P, _R, Any]]
Decorator for undoable setter function construction.
- property is_blocked: bool¶
True if manager is blocked.
- merge_commands(start: int, stop: int, formatter: Callable | None = None) None[source]¶
Merge a command set into the undo stack.
- merging(formatter: Callable | None = None) None[source]¶
Merge all the commands into a single command in this context.
- property(fget: Callable[[Any], Any] | None = None, fset: Callable[[Any, Any], None] | None = None, fdel: Callable[[Any], None] | None = None, doc: str | None = None) UndoableProperty[source]¶
Decorator for undoable property construction.
- property stack_lengths: collections_undo._stack_utils.LengthPair¶
Return length of undo and redo stack
- property stack_redo: list[collections_undo._command._CommandBase]¶
List of redo stack.
- property stack_size: float¶
Return size of undo and redo stack
- property stack_undo: list[collections_undo._command._CommandBase]¶
List of undo stack.
- undef(undef: collections_undo._stack._F) collections_undo._stack._F[source]¶
Mark an function as an undo-undefined function.
When marked function is called, undo/redo stack get cleared.
- undoable(f: Callable[_P, _R], name: str | None = None) ReversibleFunction[_P, _R, Any][source]¶
- undoable(f: property, name: str | None = None) collections_undo._undoable.UndoableProperty
- undoable(f: Literal[None], name: str | None = None) Callable[[Callable[_P, _R]], ReversibleFunction[_P, _R, Any]] | Callable[[property], UndoableProperty]
Decorator for undoable object construction.