Beispiel #1
0
 def do_send(self, arg, opts=None):
     args = arg.split()
     if len(args) > 1 and args[0] in (self.coms_list.keys() + ['all']):
         if args[0] == 'all':
             for com in self.coms_list:
                 self.coms_list[com].queue_out.put(' '.join(args[1:]))
         else:
             self.coms_list[args[0]].queue_out.put(' '.join(args[1:]))
     else:
         cprint.warn_p("unknow port: %s!" % (arg))
Beispiel #2
0
 def do_log(self, arg, opts=None):
     level = {
         '0': logging.CRITICAL,
         '1': logging.ERROR,
         '2': logging.WARNING,
         '3': logging.INFO,
         '4': logging.DEBUG,
     }
     if int(arg) in range(5):
         self.LOG.set_level(level[arg])
     else:
         cprint.warn_p("unknow log level: %s!" % (arg))
Beispiel #3
0
 def do_st(self, arg, opts=None):
     if len(arg) and arg in self.coms_list:
         self.coms_list[arg].show_state()
     else:
         cprint.warn_p("unknow port: %s!" % (arg))