diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-03 20:03:26 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-03 20:03:26 +0000 |
commit | 75c118cf7675e6f19cbb80bc16e92740676c7f4b (patch) | |
tree | b7840cfab1291920b36df87833c253051d4b54f0 /examples | |
parent | Adding upstream version 3.0.26. (diff) | |
download | ptpython-upstream/3.0.27.tar.xz ptpython-upstream/3.0.27.zip |
Adding upstream version 3.0.27.upstream/3.0.27
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'examples')
-rwxr-xr-x | examples/asyncio-python-embed.py | 1 | ||||
-rwxr-xr-x | examples/asyncio-ssh-python-embed.py | 1 | ||||
-rw-r--r-- | examples/ptpython_config/config.py | 1 | ||||
-rwxr-xr-x | examples/python-embed-with-custom-prompt.py | 1 | ||||
-rwxr-xr-x | examples/python-embed.py | 4 | ||||
-rwxr-xr-x | examples/python-input.py | 4 | ||||
-rw-r--r-- | examples/test-cases/ptpython-in-other-thread.py | 1 |
7 files changed, 9 insertions, 4 deletions
diff --git a/examples/asyncio-python-embed.py b/examples/asyncio-python-embed.py index a8fbba5..38cc1c2 100755 --- a/examples/asyncio-python-embed.py +++ b/examples/asyncio-python-embed.py @@ -11,6 +11,7 @@ The ``patch_stdout`` option makes sure that when another coroutine is writing to stdout, it won't break the input line, but instead writes nicely above the prompt. """ + import asyncio from ptpython.repl import embed diff --git a/examples/asyncio-ssh-python-embed.py b/examples/asyncio-ssh-python-embed.py index be0689e..9bbad86 100755 --- a/examples/asyncio-ssh-python-embed.py +++ b/examples/asyncio-ssh-python-embed.py @@ -5,6 +5,7 @@ This requires Python 3, asyncio and asyncssh. Run this example and then SSH to localhost, port 8222. """ + import asyncio import logging diff --git a/examples/ptpython_config/config.py b/examples/ptpython_config/config.py index b25850a..bfd3914 100644 --- a/examples/ptpython_config/config.py +++ b/examples/ptpython_config/config.py @@ -5,6 +5,7 @@ Copy this file to $XDG_CONFIG_HOME/ptpython/config.py On Linux, this is: ~/.config/ptpython/config.py On macOS, this is: ~/Library/Application Support/ptpython/config.py """ + from prompt_toolkit.filters import ViInsertMode from prompt_toolkit.key_binding.key_processor import KeyPress from prompt_toolkit.keys import Keys diff --git a/examples/python-embed-with-custom-prompt.py b/examples/python-embed-with-custom-prompt.py index d54da1d..5e8c707 100755 --- a/examples/python-embed-with-custom-prompt.py +++ b/examples/python-embed-with-custom-prompt.py @@ -2,6 +2,7 @@ """ Example of embedding a Python REPL, and setting a custom prompt. """ + from prompt_toolkit.formatted_text import HTML, AnyFormattedText from ptpython.prompt_style import PromptStyle diff --git a/examples/python-embed.py b/examples/python-embed.py index 49224ac..a748101 100755 --- a/examples/python-embed.py +++ b/examples/python-embed.py @@ -1,6 +1,6 @@ #!/usr/bin/env python -""" -""" +""" """ + from ptpython.repl import embed diff --git a/examples/python-input.py b/examples/python-input.py index 567c2ee..d586d0f 100755 --- a/examples/python-input.py +++ b/examples/python-input.py @@ -1,6 +1,6 @@ #!/usr/bin/env python -""" -""" +""" """ + from ptpython.python_input import PythonInput diff --git a/examples/test-cases/ptpython-in-other-thread.py b/examples/test-cases/ptpython-in-other-thread.py index 7c78846..bfe1410 100644 --- a/examples/test-cases/ptpython-in-other-thread.py +++ b/examples/test-cases/ptpython-in-other-thread.py @@ -5,6 +5,7 @@ Example of running ptpython in another thread. (For testing whether it's working fine if it's not embedded in the main thread.) """ + import threading from ptpython.repl import embed |