调整
This commit is contained in:
parent
2e0e9425fc
commit
c4f9670738
10
main.py
10
main.py
@ -66,10 +66,10 @@ class Console(cmd2.Cmd):
|
|||||||
future = asyncio.run_coroutine_threadsafe(_input(prompt), self.ioLoop)
|
future = asyncio.run_coroutine_threadsafe(_input(prompt), self.ioLoop)
|
||||||
return await asyncio.wrap_future(future)
|
return await asyncio.wrap_future(future)
|
||||||
|
|
||||||
async def AsyncPrint(self, output):
|
async def AsyncPrint(self, *args, **kwargs):
|
||||||
async def _print(output):
|
async def _print(*args, **kwargs):
|
||||||
print(output)
|
print(*args, **kwargs)
|
||||||
future = asyncio.run_coroutine_threadsafe(_print(output), self.ioLoop)
|
future = asyncio.run_coroutine_threadsafe(_print(*args, **kwargs), self.ioLoop)
|
||||||
await asyncio.wrap_future(future)
|
await asyncio.wrap_future(future)
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
@ -90,7 +90,7 @@ class Console(cmd2.Cmd):
|
|||||||
# 3. 设置console
|
# 3. 设置console
|
||||||
self.saved_readline_settings = None
|
self.saved_readline_settings = None
|
||||||
with self.sigint_protection:
|
with self.sigint_protection:
|
||||||
saved_readline_settings = self._set_up_cmd2_readline()
|
self.saved_readline_settings = self._set_up_cmd2_readline()
|
||||||
|
|
||||||
def postloop(self):
|
def postloop(self):
|
||||||
# 1. 还原console设置
|
# 1. 还原console设置
|
||||||
|
Loading…
x
Reference in New Issue
Block a user