def on_line_entered(self,line):
if self._cmd:
try:
res = self._cmd(line)
except Exception,e:
self.output('Error: %s'%e, 'error')
return
if res==Commander.Exit:
raise urwid.ExitMainLoop()
elif res:
# self.output(str(res))
self.output(res)
else:
if line in ('q','quit','exit'):
raise urwid.ExitMainLoop()
else:
self.output(line)
评论列表
文章目录