def do_clear(self, arg):
        if not self.ctl.upcheck():
            return

        names = arg.strip().split()

        if not names:
            self.ctl.output('Error: clear requires a process name')
            self.help_clear()
            return

        supervisor = self.ctl.get_supervisor()

        if 'all' in names:
            results = supervisor.clearAllProcessLogs()
            for result in results:
                result = self._clearresult(result)
                self.ctl.output(result)

        else:

            for name in names:
                try:
                    result = supervisor.clearProcessLogs(name)
                except xmlrpclib.Fault, e:
                    error = self._clearresult({'status':e.faultCode,
                                               'name':name,
                                               'description':e.faultString})
                    self.ctl.output(error)
                else:
                    self.ctl.output('%s: cleared' % name)
dataset/ETHPy150Open XiaoMi/minos/supervisor/supervisor/supervisorctl.py/DefaultControllerPlugin.do_clear/original