def _listen(self):
conf = self.config_manager.config
while self.run_loop:
try:
t_input = await self._readline()
except CancelledError:
raise
except Exception:
self.logger.exception("Exception waiting for input: ", exc_info=True)
continue
args = shlex.split(t_input)
if not args:
continue
elif args[0].lower() in self.con_commands:
try:
await self.con_commands[args[0].lower()](args[1:])
except ConsoleCommandSyntaxError as e:
err = str(e) if str(e) else "No additional information."
print("Syntax error: " + err)
except CancelledError:
raise
except Exception:
self.logger.exception("Exception while running console command: ", exc_info=True)
else:
print("Invalid command.")
# Console command functions
评论列表
文章目录