-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathviewmodelplugin.py
More file actions
45 lines (31 loc) · 852 Bytes
/
viewmodelplugin.py
File metadata and controls
45 lines (31 loc) · 852 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
from abc import ABC, abstractmethod
from yapsy.IPlugin import IPlugin
from PySide6.QtGui import QIcon
from app.views import ViewModel
from .options import DataOption
class ViewModelPlugin(IPlugin, ABC):
@property
@abstractmethod
def name(self) -> str:
pass
@property
def icon(self) -> QIcon | None:
return None
@property
def add_to_toolbar(self) -> bool:
return False
@property
def options(self) -> dict[str, DataOption]:
return {}
@abstractmethod
def can_process(self, model: ViewModel) -> bool:
pass
@abstractmethod
def process(self, model: ViewModel, **kwargs) -> ViewModel:
pass
class FilterPlugin(ViewModelPlugin):
pass
class ViewPlugin(ViewModelPlugin):
@property
def display_markers(self) -> bool:
return False