fix debugging
This commit is contained in:
@ -22,9 +22,6 @@ class MyCmd(cmd.Cmd):
|
||||
self.intro = "Hello at the yadyn cli\n"
|
||||
self.prompt = "yadyn> "
|
||||
|
||||
def do_hello(self, l):
|
||||
self.stdout.write("DO: %s\n" % l)
|
||||
|
||||
def do_list(self, l):
|
||||
try:
|
||||
parts = l.split(' ')
|
||||
@ -89,6 +86,20 @@ class MyCmd(cmd.Cmd):
|
||||
except LocalMyCmdException, e:
|
||||
self.stdout.write("Failure: %s\n" % str(e.msg))
|
||||
|
||||
def do_debug(self, l):
|
||||
try:
|
||||
parts = l.split(' ')
|
||||
if len(parts) != 1:
|
||||
raise LocalMyCmdException("illegal number of arguments")
|
||||
if parts[0] == 'on':
|
||||
Logger.debugEnable()
|
||||
elif parts[0] == 'off':
|
||||
Logger.debugDisable()
|
||||
else:
|
||||
raise LocalMyCmdException("illegal argument")
|
||||
except LocalMyCmdException, e:
|
||||
self.stdout.write("Failure: %s\n" % str(e.msg))
|
||||
|
||||
|
||||
def do_quit(self, l):
|
||||
self.stdout.write("Bye\n")
|
||||
|
Reference in New Issue
Block a user