-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwidget.py
More file actions
58 lines (48 loc) · 1.62 KB
/
widget.py
File metadata and controls
58 lines (48 loc) · 1.62 KB
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
46
47
48
49
50
51
52
53
54
55
56
57
58
# widget.py
# Provides the framework for the widget class that people will implement in order to create a plugin
# A widget is an abstract class that creators will implement a subclass from in order to create their widget
from abc import ABC, abstractmethod
class Widget(ABC):
# Widget Name - The human readable name of the widget
@property
@abstractmethod
def widgetName(self):
pass
# Widget ID - A hard coded string that uniquely identifies the widget
@property
@abstractmethod
def widgetID(self):
pass
# Widget HTML - HTML data that describes how to display the widget
@property
@abstractmethod
def widgetHTML(self):
pass
# Widget Data - JSON that has any data the widget needs to store
@property
@abstractmethod
def widgetData(self):
pass
# Widget Preferences - Any important preference variables defined for the widget
@property
@abstractmethod
def widgetPreferences(self):
pass
# Widget Default Preferences - Loaded to the widget's preferences by default
@property
@abstractmethod
def widgetDefaultPreferences(self):
pass
# Update Timer - Define how often (In milliseconds) this widget should update
@property
@abstractmethod
def updateTimer(self):
pass
# Update() - Function to be run each time the widget needs to update
@abstractmethod
def update(self):
pass
# Handle Event() - Function that handles any events that the widget might need to handle for the sake of interactivity
@abstractmethod
def handle_event(self, event, args):
pass