48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
|
a = self.help
# first cmdline arg == action
else:
command = actions[0]
if command in dir(self):
cmd = self.__getattribute__(command)
else:
print "No such command:", command
return
# run
result = cmd(*actions[1:])
if result:
self.json(result)
|
|
|
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
|
a = self.help
# first cmdline arg == action
else:
command = actions[0]
if command in dir(self):
cmd = self.__getattribute__(command)
else:
log.ERR("No such command:", command)
return
# run
result = cmd(*actions[1:])
if result:
self.json(result)
|