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