1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 from flumotion.component.base.admin_text import BaseAdminText
19
20 import string
21
22 from twisted.internet import defer
23
24 __version__ = "$Rev$"
25
26
27 -class DiskerAdminText(BaseAdminText):
28 commands = ['changefile']
29 filename_change_defers = []
30
33
34 - def getCompletions(self, input):
35 input_split = input.split()
36 available_commands = []
37 if input.endswith(' '):
38 input_split.append('')
39 if len(input_split) <= 1:
40 for c in self.commands:
41 if c.startswith(string.lower(input_split[0])):
42 available_commands.append(c)
43 return available_commands
44
45 - def runCommand(self, command):
46 command_split = command.split()
47 if string.lower(command_split[0]) == 'changefile':
48
49 self.callRemote("changeFilename")
50 newd = defer.Deferred()
51 self.filename_change_defers.append(newd)
52 return newd
53 else:
54 return None
55
60
61 UIClass = DiskerAdminText
62