-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPluginBase.py
More file actions
40 lines (32 loc) · 1006 Bytes
/
PluginBase.py
File metadata and controls
40 lines (32 loc) · 1006 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
"""
Base class for plugins exposing 3rd party computational backends.
Plugins are just wrappers for property calls to backends.
No state should be kept in the instance. Everything should be passed from the Calculator.
"""
class PluginBase(object):
"""
"""
def __init__(self, parent=None):
"""
"""
pass
def name(self):
"""
plugin name getter
"""
assert("VIRTUAL METHOD NOT IMPLEMENTED")
def canCalculate(self, prop=None):
"""
Check if this plugin can calculate requested property
"""
assert("VIRTUAL METHOD NOT IMPLEMENTED")
def startBackend(self, **kwargs):
"""
Start/connect to the 3rd party backend
"""
assert("VIRTUAL METHOD NOT IMPLEMENTED")
def getProperty(self, prop="", **kwargs):
"""
Translate generic Calculator request for property into local method call
"""
assert("VIRTUAL METHOD NOT IMPLEMENTED")