コード例 #1
0
        async def do_in_terminal() -> None:
            async with in_terminal():
                result = await history.app.run_async()
                if result is not None:
                    self.default_buffer.text = result

                app.vi_state.input_mode = InputMode.INSERT
コード例 #2
0
 async def _(event):
     """
     Example of asyncio coroutine as a key binding.
     """
     try:
         for i in range(5):
             async with in_terminal():
                 print("hello")
             await asyncio.sleep(1)
     except asyncio.CancelledError:
         print("Prompt terminated before we completed.")
コード例 #3
0
ファイル: _miniterm.py プロジェクト: vznncv/vznncv-miniterm
 async def write_line_async(self, text):
     text = self._cleanup_text(text)
     text = text.strip()
     async with in_terminal():
         prompt_toolkit.print_formatted_text(FormattedText([(self._async_output_color, text)]), end='\n')
コード例 #4
0
ファイル: shell.py プロジェクト: flashashen/dsh2
 async def print_context(event):
     async with in_terminal():
         pprint.pprint(api.format_dict(self.root_node.context))
コード例 #5
0
ファイル: shell.py プロジェクト: flashashen/dsh2
 async def print_flange_info(event):
     async with in_terminal():
         self.root_node.flange.info()