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