-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmanage_base.py
36 lines (29 loc) · 976 Bytes
/
manage_base.py
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
"""
Plugin Base Class of Management System
"""
class ManagePluginBase:
"""
Abstract base class for all plugins of management system
attributes:
description Discription for command function
"""
description = 'No description is provided for this command.'
@classmethod
def get_description(cls):
return cls.description
@classmethod
def func(cls, *args, **kargs):
"""
Main function is defined here. Subclass should override the method.
error:
NotImplementedError Any subclass which doesn't override the method
raises NotImplementedError while the function
is called directly or indirectly
"""
raise NotImplementedError('Command is not implemented yet.')
@classmethod
def __call__(cls, *args, **kargs):
"""
Shorthand to call func
"""
return cls.func(*args, **kargs)