1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 from zope.interface import implements
19
20 from flumotion.common import log
21 from flumotion.twisted import flavors
22
23 __version__ = "$Rev$"
24
25
26 -class BaseAdminText(log.Loggable):
27 """
28 I am a base class for all Text-based Admin views.
29 I am a view on one component's properties.
30 """
31
32 implements(flavors.IStateListener)
33
34 logCategory = "admintext"
35
36 state = admin = 'hello pychecker'
37
38 - def __init__(self, state, admin):
39 """
40 @param state: state of component this is a UI for
41 @type state: L{flumotion.common.planet.AdminComponentState}
42 @type admin: L{flumotion.admin.admin.AdminModel}
43 @param admin: the admin model that interfaces with the manager for us
44 """
45 self.state = state
46 self.name = state.get('name')
47 self.admin = admin
48 self.debug('creating admin text for state %r' % state)
49
50 - def callRemote(self, methodName, *args, **kwargs):
53
54
55
57 """
58 Set up the admin view so it can display nodes.
59 """
60 raise NotImplementedError("Child class needs to implement setup")
61
62 - def uiStateChanged(self, stateObject):
65
66 - def stateSet(self, object, key, value):
67 self.uiStateChanged(object)
68
69 - def stateAppend(self, object, key, value):
70 self.uiStateChanged(object)
71
72 - def stateRemove(self, object, key, value):
73 self.uiStateChanged(object)
74
75
76
77 - def getCompletions(self, input):
79
80
81
82 - def runCommand(self, command):
84