|
@@ -0,0 +1,20 @@
|
|
1
|
+from .plugins import Plugin
|
|
2
|
+from .exceptions import *
|
|
3
|
+from lodel.settings.validator import SettingValidator
|
|
4
|
+
|
|
5
|
+class InterfacePlugin(Plugin):
|
|
6
|
+
|
|
7
|
+ ##@brief Singleton instance storage
|
|
8
|
+ _instance = None
|
|
9
|
+
|
|
10
|
+ _plist_confspecs = {
|
|
11
|
+ 'section': 'lodel2',
|
|
12
|
+ 'key': 'interface',
|
|
13
|
+ 'default': None,
|
|
14
|
+ 'validator': SettingValidator('strip', none_is_valid = True)}
|
|
15
|
+
|
|
16
|
+ def __init__(self, name):
|
|
17
|
+ if InterfacePlugin._instance is not None:
|
|
18
|
+ raise PluginError("Maximum one interface allowed")
|
|
19
|
+ super().__init__(name)
|
|
20
|
+ self._instance = self
|