anki/qt/aqt/operations/__init__.py
Damien Elmes f6ec5928ae allow ops to pass metadata into perform_op()
Instances can pass handled_by=self to more easily ignore events they
initiate.

Fixes ugly refresh when expanding/collapsing decks, but we're still
refreshing the card/notes area unnecessarily in that case.
2021-04-05 13:43:09 +10:00

17 lines
465 B
Python

# Copyright: Ankitects Pty Ltd and contributors
# License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
from dataclasses import dataclass
from typing import Optional
@dataclass
class OpMeta:
"""Metadata associated with an operation.
The `handled_by` field can be used by screens to ignore change
events they initiated themselves, if they have already made
the required changes."""
handled_by: Optional[object] = None