@rowstile/cli-win32-x64 0.1.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +202 -0
- package/README.md +5 -0
- package/package.json +23 -0
- package/python/DLLs/_asyncio.pyd +0 -0
- package/python/DLLs/_bz2.pyd +0 -0
- package/python/DLLs/_ctypes.pyd +0 -0
- package/python/DLLs/_ctypes_test.pyd +0 -0
- package/python/DLLs/_decimal.pyd +0 -0
- package/python/DLLs/_elementtree.pyd +0 -0
- package/python/DLLs/_hashlib.pyd +0 -0
- package/python/DLLs/_lzma.pyd +0 -0
- package/python/DLLs/_multiprocessing.pyd +0 -0
- package/python/DLLs/_overlapped.pyd +0 -0
- package/python/DLLs/_queue.pyd +0 -0
- package/python/DLLs/_socket.pyd +0 -0
- package/python/DLLs/_sqlite3.pyd +0 -0
- package/python/DLLs/_ssl.pyd +0 -0
- package/python/DLLs/_testbuffer.pyd +0 -0
- package/python/DLLs/_testcapi.pyd +0 -0
- package/python/DLLs/_testclinic.pyd +0 -0
- package/python/DLLs/_testclinic_limited.pyd +0 -0
- package/python/DLLs/_testconsole.pyd +0 -0
- package/python/DLLs/_testimportmultiple.pyd +0 -0
- package/python/DLLs/_testinternalcapi.pyd +0 -0
- package/python/DLLs/_testlimitedcapi.pyd +0 -0
- package/python/DLLs/_testmultiphase.pyd +0 -0
- package/python/DLLs/_testsinglephase.pyd +0 -0
- package/python/DLLs/_uuid.pyd +0 -0
- package/python/DLLs/_wmi.pyd +0 -0
- package/python/DLLs/_zoneinfo.pyd +0 -0
- package/python/DLLs/libcrypto-3-x64.dll +0 -0
- package/python/DLLs/libffi-8.dll +0 -0
- package/python/DLLs/libssl-3-x64.dll +0 -0
- package/python/DLLs/pyexpat.pyd +0 -0
- package/python/DLLs/select.pyd +0 -0
- package/python/DLLs/sqlite3.dll +0 -0
- package/python/DLLs/unicodedata.pyd +0 -0
- package/python/DLLs/winsound.pyd +0 -0
- package/python/DLLs/zlib1.dll +0 -0
- package/python/LICENSE.txt +445 -0
- package/python/Lib/__future__.py +147 -0
- package/python/Lib/__hello__.py +16 -0
- package/python/Lib/__pycache__/__future__.cpython-313.pyc +0 -0
- package/python/Lib/__pycache__/_colorize.cpython-313.pyc +0 -0
- package/python/Lib/__pycache__/_compat_pickle.cpython-313.pyc +0 -0
- package/python/Lib/__pycache__/_compression.cpython-313.pyc +0 -0
- package/python/Lib/__pycache__/_markupbase.cpython-313.pyc +0 -0
- package/python/Lib/__pycache__/_opcode_metadata.cpython-313.pyc +0 -0
- package/python/Lib/__pycache__/_weakrefset.cpython-313.pyc +0 -0
- package/python/Lib/__pycache__/ast.cpython-313.pyc +0 -0
- package/python/Lib/__pycache__/base64.cpython-313.pyc +0 -0
- package/python/Lib/__pycache__/bisect.cpython-313.pyc +0 -0
- package/python/Lib/__pycache__/bz2.cpython-313.pyc +0 -0
- package/python/Lib/__pycache__/calendar.cpython-313.pyc +0 -0
- package/python/Lib/__pycache__/colorsys.cpython-313.pyc +0 -0
- package/python/Lib/__pycache__/compileall.cpython-313.pyc +0 -0
- package/python/Lib/__pycache__/configparser.cpython-313.pyc +0 -0
- package/python/Lib/__pycache__/contextlib.cpython-313.pyc +0 -0
- package/python/Lib/__pycache__/copy.cpython-313.pyc +0 -0
- package/python/Lib/__pycache__/copyreg.cpython-313.pyc +0 -0
- package/python/Lib/__pycache__/csv.cpython-313.pyc +0 -0
- package/python/Lib/__pycache__/dataclasses.cpython-313.pyc +0 -0
- package/python/Lib/__pycache__/datetime.cpython-313.pyc +0 -0
- package/python/Lib/__pycache__/decimal.cpython-313.pyc +0 -0
- package/python/Lib/__pycache__/dis.cpython-313.pyc +0 -0
- package/python/Lib/__pycache__/enum.cpython-313.pyc +0 -0
- package/python/Lib/__pycache__/filecmp.cpython-313.pyc +0 -0
- package/python/Lib/__pycache__/fnmatch.cpython-313.pyc +0 -0
- package/python/Lib/__pycache__/fractions.cpython-313.pyc +0 -0
- package/python/Lib/__pycache__/functools.cpython-313.pyc +0 -0
- package/python/Lib/__pycache__/getpass.cpython-313.pyc +0 -0
- package/python/Lib/__pycache__/gettext.cpython-313.pyc +0 -0
- package/python/Lib/__pycache__/glob.cpython-313.pyc +0 -0
- package/python/Lib/__pycache__/gzip.cpython-313.pyc +0 -0
- package/python/Lib/__pycache__/hashlib.cpython-313.pyc +0 -0
- package/python/Lib/__pycache__/heapq.cpython-313.pyc +0 -0
- package/python/Lib/__pycache__/hmac.cpython-313.pyc +0 -0
- package/python/Lib/__pycache__/inspect.cpython-313.pyc +0 -0
- package/python/Lib/__pycache__/ipaddress.cpython-313.pyc +0 -0
- package/python/Lib/__pycache__/keyword.cpython-313.pyc +0 -0
- package/python/Lib/__pycache__/linecache.cpython-313.pyc +0 -0
- package/python/Lib/__pycache__/locale.cpython-313.pyc +0 -0
- package/python/Lib/__pycache__/lzma.cpython-313.pyc +0 -0
- package/python/Lib/__pycache__/mimetypes.cpython-313.pyc +0 -0
- package/python/Lib/__pycache__/nturl2path.cpython-313.pyc +0 -0
- package/python/Lib/__pycache__/numbers.cpython-313.pyc +0 -0
- package/python/Lib/__pycache__/opcode.cpython-313.pyc +0 -0
- package/python/Lib/__pycache__/operator.cpython-313.pyc +0 -0
- package/python/Lib/__pycache__/optparse.cpython-313.pyc +0 -0
- package/python/Lib/__pycache__/pickle.cpython-313.pyc +0 -0
- package/python/Lib/__pycache__/pkgutil.cpython-313.pyc +0 -0
- package/python/Lib/__pycache__/platform.cpython-313.pyc +0 -0
- package/python/Lib/__pycache__/py_compile.cpython-313.pyc +0 -0
- package/python/Lib/__pycache__/queue.cpython-313.pyc +0 -0
- package/python/Lib/__pycache__/quopri.cpython-313.pyc +0 -0
- package/python/Lib/__pycache__/random.cpython-313.pyc +0 -0
- package/python/Lib/__pycache__/reprlib.cpython-313.pyc +0 -0
- package/python/Lib/__pycache__/selectors.cpython-313.pyc +0 -0
- package/python/Lib/__pycache__/shlex.cpython-313.pyc +0 -0
- package/python/Lib/__pycache__/shutil.cpython-313.pyc +0 -0
- package/python/Lib/__pycache__/signal.cpython-313.pyc +0 -0
- package/python/Lib/__pycache__/socket.cpython-313.pyc +0 -0
- package/python/Lib/__pycache__/socketserver.cpython-313.pyc +0 -0
- package/python/Lib/__pycache__/ssl.cpython-313.pyc +0 -0
- package/python/Lib/__pycache__/string.cpython-313.pyc +0 -0
- package/python/Lib/__pycache__/stringprep.cpython-313.pyc +0 -0
- package/python/Lib/__pycache__/struct.cpython-313.pyc +0 -0
- package/python/Lib/__pycache__/subprocess.cpython-313.pyc +0 -0
- package/python/Lib/__pycache__/tarfile.cpython-313.pyc +0 -0
- package/python/Lib/__pycache__/tempfile.cpython-313.pyc +0 -0
- package/python/Lib/__pycache__/textwrap.cpython-313.pyc +0 -0
- package/python/Lib/__pycache__/threading.cpython-313.pyc +0 -0
- package/python/Lib/__pycache__/token.cpython-313.pyc +0 -0
- package/python/Lib/__pycache__/tokenize.cpython-313.pyc +0 -0
- package/python/Lib/__pycache__/traceback.cpython-313.pyc +0 -0
- package/python/Lib/__pycache__/types.cpython-313.pyc +0 -0
- package/python/Lib/__pycache__/typing.cpython-313.pyc +0 -0
- package/python/Lib/__pycache__/uuid.cpython-313.pyc +0 -0
- package/python/Lib/__pycache__/warnings.cpython-313.pyc +0 -0
- package/python/Lib/__pycache__/weakref.cpython-313.pyc +0 -0
- package/python/Lib/_aix_support.py +108 -0
- package/python/Lib/_android_support.py +192 -0
- package/python/Lib/_apple_support.py +66 -0
- package/python/Lib/_collections_abc.py +1187 -0
- package/python/Lib/_colorize.py +119 -0
- package/python/Lib/_compat_pickle.py +251 -0
- package/python/Lib/_compression.py +162 -0
- package/python/Lib/_ios_support.py +71 -0
- package/python/Lib/_markupbase.py +396 -0
- package/python/Lib/_opcode_metadata.py +343 -0
- package/python/Lib/_osx_support.py +579 -0
- package/python/Lib/_py_abc.py +147 -0
- package/python/Lib/_pydatetime.py +2640 -0
- package/python/Lib/_pydecimal.py +6356 -0
- package/python/Lib/_pyio.py +2714 -0
- package/python/Lib/_pylong.py +363 -0
- package/python/Lib/_pyrepl/__init__.py +19 -0
- package/python/Lib/_pyrepl/__main__.py +10 -0
- package/python/Lib/_pyrepl/_minimal_curses.py +68 -0
- package/python/Lib/_pyrepl/_threading_handler.py +74 -0
- package/python/Lib/_pyrepl/base_eventqueue.py +110 -0
- package/python/Lib/_pyrepl/commands.py +492 -0
- package/python/Lib/_pyrepl/completing_reader.py +295 -0
- package/python/Lib/_pyrepl/console.py +229 -0
- package/python/Lib/_pyrepl/curses.py +33 -0
- package/python/Lib/_pyrepl/fancy_termios.py +82 -0
- package/python/Lib/_pyrepl/historical_reader.py +419 -0
- package/python/Lib/_pyrepl/input.py +114 -0
- package/python/Lib/_pyrepl/keymap.py +213 -0
- package/python/Lib/_pyrepl/main.py +59 -0
- package/python/Lib/_pyrepl/mypy.ini +29 -0
- package/python/Lib/_pyrepl/pager.py +175 -0
- package/python/Lib/_pyrepl/reader.py +764 -0
- package/python/Lib/_pyrepl/readline.py +599 -0
- package/python/Lib/_pyrepl/simple_interact.py +180 -0
- package/python/Lib/_pyrepl/trace.py +21 -0
- package/python/Lib/_pyrepl/types.py +10 -0
- package/python/Lib/_pyrepl/unix_console.py +852 -0
- package/python/Lib/_pyrepl/unix_eventqueue.py +76 -0
- package/python/Lib/_pyrepl/utils.py +83 -0
- package/python/Lib/_pyrepl/windows_console.py +687 -0
- package/python/Lib/_pyrepl/windows_eventqueue.py +42 -0
- package/python/Lib/_sitebuiltins.py +91 -0
- package/python/Lib/_strptime.py +800 -0
- package/python/Lib/_threading_local.py +120 -0
- package/python/Lib/_weakrefset.py +205 -0
- package/python/Lib/abc.py +188 -0
- package/python/Lib/antigravity.py +17 -0
- package/python/Lib/argparse.py +2690 -0
- package/python/Lib/ast.py +1865 -0
- package/python/Lib/asyncio/__init__.py +47 -0
- package/python/Lib/asyncio/__main__.py +211 -0
- package/python/Lib/asyncio/base_events.py +2086 -0
- package/python/Lib/asyncio/base_futures.py +67 -0
- package/python/Lib/asyncio/base_subprocess.py +312 -0
- package/python/Lib/asyncio/base_tasks.py +94 -0
- package/python/Lib/asyncio/constants.py +41 -0
- package/python/Lib/asyncio/coroutines.py +109 -0
- package/python/Lib/asyncio/events.py +885 -0
- package/python/Lib/asyncio/exceptions.py +62 -0
- package/python/Lib/asyncio/format_helpers.py +84 -0
- package/python/Lib/asyncio/futures.py +425 -0
- package/python/Lib/asyncio/locks.py +617 -0
- package/python/Lib/asyncio/log.py +7 -0
- package/python/Lib/asyncio/mixins.py +21 -0
- package/python/Lib/asyncio/proactor_events.py +891 -0
- package/python/Lib/asyncio/protocols.py +216 -0
- package/python/Lib/asyncio/queues.py +309 -0
- package/python/Lib/asyncio/runners.py +217 -0
- package/python/Lib/asyncio/selector_events.py +1328 -0
- package/python/Lib/asyncio/sslproto.py +929 -0
- package/python/Lib/asyncio/staggered.py +174 -0
- package/python/Lib/asyncio/streams.py +787 -0
- package/python/Lib/asyncio/subprocess.py +229 -0
- package/python/Lib/asyncio/taskgroups.py +278 -0
- package/python/Lib/asyncio/tasks.py +1121 -0
- package/python/Lib/asyncio/threads.py +26 -0
- package/python/Lib/asyncio/timeouts.py +185 -0
- package/python/Lib/asyncio/transports.py +337 -0
- package/python/Lib/asyncio/trsock.py +98 -0
- package/python/Lib/asyncio/unix_events.py +1550 -0
- package/python/Lib/asyncio/windows_events.py +906 -0
- package/python/Lib/asyncio/windows_utils.py +181 -0
- package/python/Lib/base64.py +628 -0
- package/python/Lib/bdb.py +973 -0
- package/python/Lib/bisect.py +118 -0
- package/python/Lib/bz2.py +352 -0
- package/python/Lib/cProfile.py +197 -0
- package/python/Lib/calendar.py +813 -0
- package/python/Lib/cmd.py +409 -0
- package/python/Lib/code.py +386 -0
- package/python/Lib/codecs.py +1132 -0
- package/python/Lib/codeop.py +155 -0
- package/python/Lib/collections/__init__.py +1603 -0
- package/python/Lib/collections/__pycache__/__init__.cpython-313.pyc +0 -0
- package/python/Lib/colorsys.py +166 -0
- package/python/Lib/compileall.py +470 -0
- package/python/Lib/concurrent/__init__.py +1 -0
- package/python/Lib/concurrent/futures/__init__.py +54 -0
- package/python/Lib/concurrent/futures/_base.py +660 -0
- package/python/Lib/concurrent/futures/process.py +892 -0
- package/python/Lib/concurrent/futures/thread.py +240 -0
- package/python/Lib/configparser.py +1396 -0
- package/python/Lib/contextlib.py +814 -0
- package/python/Lib/contextvars.py +4 -0
- package/python/Lib/copy.py +306 -0
- package/python/Lib/copyreg.py +217 -0
- package/python/Lib/csv.py +527 -0
- package/python/Lib/ctypes/__init__.py +602 -0
- package/python/Lib/ctypes/__pycache__/__init__.cpython-313.pyc +0 -0
- package/python/Lib/ctypes/__pycache__/_endian.cpython-313.pyc +0 -0
- package/python/Lib/ctypes/__pycache__/wintypes.cpython-313.pyc +0 -0
- package/python/Lib/ctypes/_aix.py +327 -0
- package/python/Lib/ctypes/_endian.py +78 -0
- package/python/Lib/ctypes/macholib/README.ctypes +7 -0
- package/python/Lib/ctypes/macholib/__init__.py +9 -0
- package/python/Lib/ctypes/macholib/dyld.py +165 -0
- package/python/Lib/ctypes/macholib/dylib.py +42 -0
- package/python/Lib/ctypes/macholib/fetch_macholib +2 -0
- package/python/Lib/ctypes/macholib/fetch_macholib.bat +1 -0
- package/python/Lib/ctypes/macholib/framework.py +42 -0
- package/python/Lib/ctypes/util.py +387 -0
- package/python/Lib/ctypes/wintypes.py +202 -0
- package/python/Lib/curses/__init__.py +101 -0
- package/python/Lib/curses/ascii.py +99 -0
- package/python/Lib/curses/has_key.py +192 -0
- package/python/Lib/curses/panel.py +6 -0
- package/python/Lib/curses/textpad.py +236 -0
- package/python/Lib/dataclasses.py +1679 -0
- package/python/Lib/datetime.py +9 -0
- package/python/Lib/dbm/__init__.py +194 -0
- package/python/Lib/dbm/dumb.py +319 -0
- package/python/Lib/dbm/gnu.py +3 -0
- package/python/Lib/dbm/ndbm.py +3 -0
- package/python/Lib/dbm/sqlite3.py +144 -0
- package/python/Lib/decimal.py +109 -0
- package/python/Lib/difflib.py +2058 -0
- package/python/Lib/dis.py +1075 -0
- package/python/Lib/doctest.py +2919 -0
- package/python/Lib/email/__init__.py +61 -0
- package/python/Lib/email/__pycache__/__init__.cpython-313.pyc +0 -0
- package/python/Lib/email/__pycache__/_encoded_words.cpython-313.pyc +0 -0
- package/python/Lib/email/__pycache__/_parseaddr.cpython-313.pyc +0 -0
- package/python/Lib/email/__pycache__/_policybase.cpython-313.pyc +0 -0
- package/python/Lib/email/__pycache__/base64mime.cpython-313.pyc +0 -0
- package/python/Lib/email/__pycache__/charset.cpython-313.pyc +0 -0
- package/python/Lib/email/__pycache__/encoders.cpython-313.pyc +0 -0
- package/python/Lib/email/__pycache__/errors.cpython-313.pyc +0 -0
- package/python/Lib/email/__pycache__/feedparser.cpython-313.pyc +0 -0
- package/python/Lib/email/__pycache__/header.cpython-313.pyc +0 -0
- package/python/Lib/email/__pycache__/iterators.cpython-313.pyc +0 -0
- package/python/Lib/email/__pycache__/message.cpython-313.pyc +0 -0
- package/python/Lib/email/__pycache__/parser.cpython-313.pyc +0 -0
- package/python/Lib/email/__pycache__/quoprimime.cpython-313.pyc +0 -0
- package/python/Lib/email/__pycache__/utils.cpython-313.pyc +0 -0
- package/python/Lib/email/_encoded_words.py +233 -0
- package/python/Lib/email/_header_value_parser.py +3153 -0
- package/python/Lib/email/_parseaddr.py +563 -0
- package/python/Lib/email/_policybase.py +382 -0
- package/python/Lib/email/architecture.rst +216 -0
- package/python/Lib/email/base64mime.py +115 -0
- package/python/Lib/email/charset.py +396 -0
- package/python/Lib/email/contentmanager.py +254 -0
- package/python/Lib/email/encoders.py +65 -0
- package/python/Lib/email/errors.py +117 -0
- package/python/Lib/email/feedparser.py +536 -0
- package/python/Lib/email/generator.py +530 -0
- package/python/Lib/email/header.py +582 -0
- package/python/Lib/email/headerregistry.py +618 -0
- package/python/Lib/email/iterators.py +68 -0
- package/python/Lib/email/message.py +1217 -0
- package/python/Lib/email/mime/__init__.py +0 -0
- package/python/Lib/email/mime/application.py +37 -0
- package/python/Lib/email/mime/audio.py +97 -0
- package/python/Lib/email/mime/base.py +29 -0
- package/python/Lib/email/mime/image.py +152 -0
- package/python/Lib/email/mime/message.py +33 -0
- package/python/Lib/email/mime/multipart.py +47 -0
- package/python/Lib/email/mime/nonmultipart.py +21 -0
- package/python/Lib/email/mime/text.py +40 -0
- package/python/Lib/email/parser.py +127 -0
- package/python/Lib/email/policy.py +232 -0
- package/python/Lib/email/quoprimime.py +300 -0
- package/python/Lib/email/utils.py +497 -0
- package/python/Lib/encodings/__init__.py +179 -0
- package/python/Lib/encodings/__pycache__/__init__.cpython-313.pyc +0 -0
- package/python/Lib/encodings/__pycache__/aliases.cpython-313.pyc +0 -0
- package/python/Lib/encodings/__pycache__/cp1252.cpython-313.pyc +0 -0
- package/python/Lib/encodings/__pycache__/cp437.cpython-313.pyc +0 -0
- package/python/Lib/encodings/__pycache__/hex_codec.cpython-313.pyc +0 -0
- package/python/Lib/encodings/__pycache__/idna.cpython-313.pyc +0 -0
- package/python/Lib/encodings/__pycache__/utf_8.cpython-313.pyc +0 -0
- package/python/Lib/encodings/aliases.py +560 -0
- package/python/Lib/encodings/ascii.py +50 -0
- package/python/Lib/encodings/base64_codec.py +55 -0
- package/python/Lib/encodings/big5.py +39 -0
- package/python/Lib/encodings/big5hkscs.py +39 -0
- package/python/Lib/encodings/bz2_codec.py +78 -0
- package/python/Lib/encodings/charmap.py +69 -0
- package/python/Lib/encodings/cp037.py +307 -0
- package/python/Lib/encodings/cp1006.py +307 -0
- package/python/Lib/encodings/cp1026.py +307 -0
- package/python/Lib/encodings/cp1125.py +698 -0
- package/python/Lib/encodings/cp1140.py +307 -0
- package/python/Lib/encodings/cp1250.py +307 -0
- package/python/Lib/encodings/cp1251.py +307 -0
- package/python/Lib/encodings/cp1252.py +307 -0
- package/python/Lib/encodings/cp1253.py +307 -0
- package/python/Lib/encodings/cp1254.py +307 -0
- package/python/Lib/encodings/cp1255.py +307 -0
- package/python/Lib/encodings/cp1256.py +307 -0
- package/python/Lib/encodings/cp1257.py +307 -0
- package/python/Lib/encodings/cp1258.py +307 -0
- package/python/Lib/encodings/cp273.py +307 -0
- package/python/Lib/encodings/cp424.py +307 -0
- package/python/Lib/encodings/cp437.py +698 -0
- package/python/Lib/encodings/cp500.py +307 -0
- package/python/Lib/encodings/cp720.py +309 -0
- package/python/Lib/encodings/cp737.py +698 -0
- package/python/Lib/encodings/cp775.py +697 -0
- package/python/Lib/encodings/cp850.py +698 -0
- package/python/Lib/encodings/cp852.py +698 -0
- package/python/Lib/encodings/cp855.py +698 -0
- package/python/Lib/encodings/cp856.py +307 -0
- package/python/Lib/encodings/cp857.py +694 -0
- package/python/Lib/encodings/cp858.py +698 -0
- package/python/Lib/encodings/cp860.py +698 -0
- package/python/Lib/encodings/cp861.py +698 -0
- package/python/Lib/encodings/cp862.py +698 -0
- package/python/Lib/encodings/cp863.py +698 -0
- package/python/Lib/encodings/cp864.py +690 -0
- package/python/Lib/encodings/cp865.py +698 -0
- package/python/Lib/encodings/cp866.py +698 -0
- package/python/Lib/encodings/cp869.py +689 -0
- package/python/Lib/encodings/cp874.py +307 -0
- package/python/Lib/encodings/cp875.py +307 -0
- package/python/Lib/encodings/cp932.py +39 -0
- package/python/Lib/encodings/cp949.py +39 -0
- package/python/Lib/encodings/cp950.py +39 -0
- package/python/Lib/encodings/euc_jis_2004.py +39 -0
- package/python/Lib/encodings/euc_jisx0213.py +39 -0
- package/python/Lib/encodings/euc_jp.py +39 -0
- package/python/Lib/encodings/euc_kr.py +39 -0
- package/python/Lib/encodings/gb18030.py +39 -0
- package/python/Lib/encodings/gb2312.py +39 -0
- package/python/Lib/encodings/gbk.py +39 -0
- package/python/Lib/encodings/hex_codec.py +55 -0
- package/python/Lib/encodings/hp_roman8.py +314 -0
- package/python/Lib/encodings/hz.py +39 -0
- package/python/Lib/encodings/idna.py +387 -0
- package/python/Lib/encodings/iso2022_jp.py +39 -0
- package/python/Lib/encodings/iso2022_jp_1.py +39 -0
- package/python/Lib/encodings/iso2022_jp_2.py +39 -0
- package/python/Lib/encodings/iso2022_jp_2004.py +39 -0
- package/python/Lib/encodings/iso2022_jp_3.py +39 -0
- package/python/Lib/encodings/iso2022_jp_ext.py +39 -0
- package/python/Lib/encodings/iso2022_kr.py +39 -0
- package/python/Lib/encodings/iso8859_1.py +307 -0
- package/python/Lib/encodings/iso8859_10.py +307 -0
- package/python/Lib/encodings/iso8859_11.py +307 -0
- package/python/Lib/encodings/iso8859_13.py +307 -0
- package/python/Lib/encodings/iso8859_14.py +307 -0
- package/python/Lib/encodings/iso8859_15.py +307 -0
- package/python/Lib/encodings/iso8859_16.py +307 -0
- package/python/Lib/encodings/iso8859_2.py +307 -0
- package/python/Lib/encodings/iso8859_3.py +307 -0
- package/python/Lib/encodings/iso8859_4.py +307 -0
- package/python/Lib/encodings/iso8859_5.py +307 -0
- package/python/Lib/encodings/iso8859_6.py +307 -0
- package/python/Lib/encodings/iso8859_7.py +307 -0
- package/python/Lib/encodings/iso8859_8.py +307 -0
- package/python/Lib/encodings/iso8859_9.py +307 -0
- package/python/Lib/encodings/johab.py +39 -0
- package/python/Lib/encodings/koi8_r.py +307 -0
- package/python/Lib/encodings/koi8_t.py +308 -0
- package/python/Lib/encodings/koi8_u.py +307 -0
- package/python/Lib/encodings/kz1048.py +307 -0
- package/python/Lib/encodings/latin_1.py +50 -0
- package/python/Lib/encodings/mac_arabic.py +698 -0
- package/python/Lib/encodings/mac_croatian.py +307 -0
- package/python/Lib/encodings/mac_cyrillic.py +307 -0
- package/python/Lib/encodings/mac_farsi.py +307 -0
- package/python/Lib/encodings/mac_greek.py +307 -0
- package/python/Lib/encodings/mac_iceland.py +307 -0
- package/python/Lib/encodings/mac_latin2.py +312 -0
- package/python/Lib/encodings/mac_roman.py +307 -0
- package/python/Lib/encodings/mac_romanian.py +307 -0
- package/python/Lib/encodings/mac_turkish.py +307 -0
- package/python/Lib/encodings/mbcs.py +47 -0
- package/python/Lib/encodings/oem.py +41 -0
- package/python/Lib/encodings/palmos.py +308 -0
- package/python/Lib/encodings/ptcp154.py +312 -0
- package/python/Lib/encodings/punycode.py +253 -0
- package/python/Lib/encodings/quopri_codec.py +56 -0
- package/python/Lib/encodings/raw_unicode_escape.py +46 -0
- package/python/Lib/encodings/rot_13.py +113 -0
- package/python/Lib/encodings/shift_jis.py +39 -0
- package/python/Lib/encodings/shift_jis_2004.py +39 -0
- package/python/Lib/encodings/shift_jisx0213.py +39 -0
- package/python/Lib/encodings/tis_620.py +307 -0
- package/python/Lib/encodings/undefined.py +49 -0
- package/python/Lib/encodings/unicode_escape.py +46 -0
- package/python/Lib/encodings/utf_16.py +155 -0
- package/python/Lib/encodings/utf_16_be.py +42 -0
- package/python/Lib/encodings/utf_16_le.py +42 -0
- package/python/Lib/encodings/utf_32.py +150 -0
- package/python/Lib/encodings/utf_32_be.py +37 -0
- package/python/Lib/encodings/utf_32_le.py +37 -0
- package/python/Lib/encodings/utf_7.py +38 -0
- package/python/Lib/encodings/utf_8.py +42 -0
- package/python/Lib/encodings/utf_8_sig.py +130 -0
- package/python/Lib/encodings/uu_codec.py +103 -0
- package/python/Lib/encodings/zlib_codec.py +77 -0
- package/python/Lib/enum.py +2183 -0
- package/python/Lib/filecmp.py +320 -0
- package/python/Lib/fileinput.py +442 -0
- package/python/Lib/fnmatch.py +192 -0
- package/python/Lib/fractions.py +1043 -0
- package/python/Lib/ftplib.py +975 -0
- package/python/Lib/functools.py +1036 -0
- package/python/Lib/genericpath.py +200 -0
- package/python/Lib/getopt.py +215 -0
- package/python/Lib/getpass.py +192 -0
- package/python/Lib/gettext.py +657 -0
- package/python/Lib/glob.py +572 -0
- package/python/Lib/graphlib.py +250 -0
- package/python/Lib/gzip.py +693 -0
- package/python/Lib/hashlib.py +255 -0
- package/python/Lib/heapq.py +603 -0
- package/python/Lib/hmac.py +220 -0
- package/python/Lib/html/__init__.py +132 -0
- package/python/Lib/html/__pycache__/__init__.cpython-313.pyc +0 -0
- package/python/Lib/html/__pycache__/entities.cpython-313.pyc +0 -0
- package/python/Lib/html/__pycache__/parser.cpython-313.pyc +0 -0
- package/python/Lib/html/entities.py +2513 -0
- package/python/Lib/html/parser.py +583 -0
- package/python/Lib/http/__init__.py +202 -0
- package/python/Lib/http/__pycache__/__init__.cpython-313.pyc +0 -0
- package/python/Lib/http/__pycache__/client.cpython-313.pyc +0 -0
- package/python/Lib/http/__pycache__/cookiejar.cpython-313.pyc +0 -0
- package/python/Lib/http/__pycache__/cookies.cpython-313.pyc +0 -0
- package/python/Lib/http/client.py +1598 -0
- package/python/Lib/http/cookiejar.py +2122 -0
- package/python/Lib/http/cookies.py +635 -0
- package/python/Lib/http/server.py +1355 -0
- package/python/Lib/imaplib.py +1769 -0
- package/python/Lib/importlib/__init__.py +136 -0
- package/python/Lib/importlib/__pycache__/__init__.cpython-313.pyc +0 -0
- package/python/Lib/importlib/__pycache__/_abc.cpython-313.pyc +0 -0
- package/python/Lib/importlib/__pycache__/abc.cpython-313.pyc +0 -0
- package/python/Lib/importlib/__pycache__/readers.cpython-313.pyc +0 -0
- package/python/Lib/importlib/_abc.py +39 -0
- package/python/Lib/importlib/_bootstrap.py +1559 -0
- package/python/Lib/importlib/_bootstrap_external.py +1826 -0
- package/python/Lib/importlib/abc.py +243 -0
- package/python/Lib/importlib/machinery.py +21 -0
- package/python/Lib/importlib/metadata/__init__.py +1093 -0
- package/python/Lib/importlib/metadata/__pycache__/__init__.cpython-313.pyc +0 -0
- package/python/Lib/importlib/metadata/__pycache__/_adapters.cpython-313.pyc +0 -0
- package/python/Lib/importlib/metadata/__pycache__/_collections.cpython-313.pyc +0 -0
- package/python/Lib/importlib/metadata/__pycache__/_functools.cpython-313.pyc +0 -0
- package/python/Lib/importlib/metadata/__pycache__/_itertools.cpython-313.pyc +0 -0
- package/python/Lib/importlib/metadata/__pycache__/_meta.cpython-313.pyc +0 -0
- package/python/Lib/importlib/metadata/__pycache__/_text.cpython-313.pyc +0 -0
- package/python/Lib/importlib/metadata/_adapters.py +89 -0
- package/python/Lib/importlib/metadata/_collections.py +30 -0
- package/python/Lib/importlib/metadata/_functools.py +104 -0
- package/python/Lib/importlib/metadata/_itertools.py +73 -0
- package/python/Lib/importlib/metadata/_meta.py +67 -0
- package/python/Lib/importlib/metadata/_text.py +99 -0
- package/python/Lib/importlib/metadata/diagnose.py +21 -0
- package/python/Lib/importlib/readers.py +12 -0
- package/python/Lib/importlib/resources/__init__.py +43 -0
- package/python/Lib/importlib/resources/__pycache__/__init__.cpython-313.pyc +0 -0
- package/python/Lib/importlib/resources/__pycache__/_adapters.cpython-313.pyc +0 -0
- package/python/Lib/importlib/resources/__pycache__/_common.cpython-313.pyc +0 -0
- package/python/Lib/importlib/resources/__pycache__/_functional.cpython-313.pyc +0 -0
- package/python/Lib/importlib/resources/__pycache__/_itertools.cpython-313.pyc +0 -0
- package/python/Lib/importlib/resources/__pycache__/abc.cpython-313.pyc +0 -0
- package/python/Lib/importlib/resources/__pycache__/readers.cpython-313.pyc +0 -0
- package/python/Lib/importlib/resources/_adapters.py +168 -0
- package/python/Lib/importlib/resources/_common.py +211 -0
- package/python/Lib/importlib/resources/_functional.py +81 -0
- package/python/Lib/importlib/resources/_itertools.py +38 -0
- package/python/Lib/importlib/resources/abc.py +173 -0
- package/python/Lib/importlib/resources/readers.py +203 -0
- package/python/Lib/importlib/resources/simple.py +106 -0
- package/python/Lib/importlib/simple.py +14 -0
- package/python/Lib/importlib/util.py +274 -0
- package/python/Lib/inspect.py +3479 -0
- package/python/Lib/io.py +99 -0
- package/python/Lib/ipaddress.py +2440 -0
- package/python/Lib/json/__init__.py +365 -0
- package/python/Lib/json/__pycache__/__init__.cpython-313.pyc +0 -0
- package/python/Lib/json/__pycache__/decoder.cpython-313.pyc +0 -0
- package/python/Lib/json/__pycache__/encoder.cpython-313.pyc +0 -0
- package/python/Lib/json/__pycache__/scanner.cpython-313.pyc +0 -0
- package/python/Lib/json/decoder.py +364 -0
- package/python/Lib/json/encoder.py +446 -0
- package/python/Lib/json/scanner.py +73 -0
- package/python/Lib/json/tool.py +90 -0
- package/python/Lib/keyword.py +64 -0
- package/python/Lib/linecache.py +236 -0
- package/python/Lib/locale.py +1987 -0
- package/python/Lib/logging/__init__.py +2330 -0
- package/python/Lib/logging/__pycache__/__init__.cpython-313.pyc +0 -0
- package/python/Lib/logging/__pycache__/config.cpython-313.pyc +0 -0
- package/python/Lib/logging/__pycache__/handlers.cpython-313.pyc +0 -0
- package/python/Lib/logging/config.py +1080 -0
- package/python/Lib/logging/handlers.py +1629 -0
- package/python/Lib/lzma.py +364 -0
- package/python/Lib/mailbox.py +2219 -0
- package/python/Lib/mimetypes.py +679 -0
- package/python/Lib/modulefinder.py +671 -0
- package/python/Lib/multiprocessing/__init__.py +37 -0
- package/python/Lib/multiprocessing/connection.py +1216 -0
- package/python/Lib/multiprocessing/context.py +383 -0
- package/python/Lib/multiprocessing/dummy/__init__.py +126 -0
- package/python/Lib/multiprocessing/dummy/connection.py +75 -0
- package/python/Lib/multiprocessing/forkserver.py +373 -0
- package/python/Lib/multiprocessing/heap.py +337 -0
- package/python/Lib/multiprocessing/managers.py +1397 -0
- package/python/Lib/multiprocessing/pool.py +957 -0
- package/python/Lib/multiprocessing/popen_fork.py +97 -0
- package/python/Lib/multiprocessing/popen_forkserver.py +74 -0
- package/python/Lib/multiprocessing/popen_spawn_posix.py +76 -0
- package/python/Lib/multiprocessing/popen_spawn_win32.py +147 -0
- package/python/Lib/multiprocessing/process.py +436 -0
- package/python/Lib/multiprocessing/queues.py +399 -0
- package/python/Lib/multiprocessing/reduction.py +281 -0
- package/python/Lib/multiprocessing/resource_sharer.py +154 -0
- package/python/Lib/multiprocessing/resource_tracker.py +499 -0
- package/python/Lib/multiprocessing/shared_memory.py +544 -0
- package/python/Lib/multiprocessing/sharedctypes.py +240 -0
- package/python/Lib/multiprocessing/spawn.py +307 -0
- package/python/Lib/multiprocessing/synchronize.py +404 -0
- package/python/Lib/multiprocessing/util.py +562 -0
- package/python/Lib/netrc.py +199 -0
- package/python/Lib/ntpath.py +872 -0
- package/python/Lib/nturl2path.py +69 -0
- package/python/Lib/numbers.py +427 -0
- package/python/Lib/opcode.py +115 -0
- package/python/Lib/operator.py +467 -0
- package/python/Lib/optparse.py +1681 -0
- package/python/Lib/os.py +1184 -0
- package/python/Lib/pathlib/__init__.py +12 -0
- package/python/Lib/pathlib/__pycache__/__init__.cpython-313.pyc +0 -0
- package/python/Lib/pathlib/__pycache__/_abc.cpython-313.pyc +0 -0
- package/python/Lib/pathlib/__pycache__/_local.cpython-313.pyc +0 -0
- package/python/Lib/pathlib/_abc.py +930 -0
- package/python/Lib/pathlib/_local.py +861 -0
- package/python/Lib/pdb.py +2550 -0
- package/python/Lib/pickle.py +1860 -0
- package/python/Lib/pickletools.py +2904 -0
- package/python/Lib/pkgutil.py +529 -0
- package/python/Lib/platform.py +1454 -0
- package/python/Lib/plistlib.py +948 -0
- package/python/Lib/poplib.py +477 -0
- package/python/Lib/posixpath.py +578 -0
- package/python/Lib/pprint.py +658 -0
- package/python/Lib/profile.py +616 -0
- package/python/Lib/pstats.py +778 -0
- package/python/Lib/pty.py +211 -0
- package/python/Lib/py_compile.py +212 -0
- package/python/Lib/pyclbr.py +314 -0
- package/python/Lib/pydoc.py +2861 -0
- package/python/Lib/queue.py +383 -0
- package/python/Lib/quopri.py +237 -0
- package/python/Lib/random.py +1078 -0
- package/python/Lib/re/__init__.py +428 -0
- package/python/Lib/re/__pycache__/__init__.cpython-313.pyc +0 -0
- package/python/Lib/re/__pycache__/_casefix.cpython-313.pyc +0 -0
- package/python/Lib/re/__pycache__/_compiler.cpython-313.pyc +0 -0
- package/python/Lib/re/__pycache__/_constants.cpython-313.pyc +0 -0
- package/python/Lib/re/__pycache__/_parser.cpython-313.pyc +0 -0
- package/python/Lib/re/_casefix.py +106 -0
- package/python/Lib/re/_compiler.py +768 -0
- package/python/Lib/re/_constants.py +222 -0
- package/python/Lib/re/_parser.py +1081 -0
- package/python/Lib/reprlib.py +230 -0
- package/python/Lib/rlcompleter.py +222 -0
- package/python/Lib/runpy.py +326 -0
- package/python/Lib/sched.py +167 -0
- package/python/Lib/secrets.py +71 -0
- package/python/Lib/selectors.py +603 -0
- package/python/Lib/shelve.py +250 -0
- package/python/Lib/shlex.py +345 -0
- package/python/Lib/shutil.py +1569 -0
- package/python/Lib/signal.py +94 -0
- package/python/Lib/site.py +773 -0
- package/python/Lib/smtplib.py +1123 -0
- package/python/Lib/socket.py +988 -0
- package/python/Lib/socketserver.py +863 -0
- package/python/Lib/sqlite3/__init__.py +70 -0
- package/python/Lib/sqlite3/__main__.py +139 -0
- package/python/Lib/sqlite3/dbapi2.py +108 -0
- package/python/Lib/sqlite3/dump.py +118 -0
- package/python/Lib/sre_compile.py +7 -0
- package/python/Lib/sre_constants.py +7 -0
- package/python/Lib/sre_parse.py +7 -0
- package/python/Lib/ssl.py +1529 -0
- package/python/Lib/stat.py +212 -0
- package/python/Lib/statistics.py +1817 -0
- package/python/Lib/string.py +314 -0
- package/python/Lib/stringprep.py +272 -0
- package/python/Lib/struct.py +15 -0
- package/python/Lib/subprocess.py +2258 -0
- package/python/Lib/symtable.py +414 -0
- package/python/Lib/sysconfig/__init__.py +734 -0
- package/python/Lib/sysconfig/__main__.py +248 -0
- package/python/Lib/sysconfig/__pycache__/__init__.cpython-313.pyc +0 -0
- package/python/Lib/tabnanny.py +340 -0
- package/python/Lib/tarfile.py +3136 -0
- package/python/Lib/tempfile.py +958 -0
- package/python/Lib/textwrap.py +497 -0
- package/python/Lib/this.py +28 -0
- package/python/Lib/threading.py +1602 -0
- package/python/Lib/timeit.py +381 -0
- package/python/Lib/token.py +141 -0
- package/python/Lib/tokenize.py +592 -0
- package/python/Lib/tomllib/__init__.py +10 -0
- package/python/Lib/tomllib/__pycache__/__init__.cpython-313.pyc +0 -0
- package/python/Lib/tomllib/__pycache__/_parser.cpython-313.pyc +0 -0
- package/python/Lib/tomllib/__pycache__/_re.cpython-313.pyc +0 -0
- package/python/Lib/tomllib/__pycache__/_types.cpython-313.pyc +0 -0
- package/python/Lib/tomllib/_parser.py +703 -0
- package/python/Lib/tomllib/_re.py +107 -0
- package/python/Lib/tomllib/_types.py +10 -0
- package/python/Lib/tomllib/mypy.ini +15 -0
- package/python/Lib/trace.py +754 -0
- package/python/Lib/traceback.py +1639 -0
- package/python/Lib/tracemalloc.py +560 -0
- package/python/Lib/tty.py +73 -0
- package/python/Lib/types.py +346 -0
- package/python/Lib/typing.py +3846 -0
- package/python/Lib/unittest/__init__.py +80 -0
- package/python/Lib/unittest/__main__.py +18 -0
- package/python/Lib/unittest/_log.py +86 -0
- package/python/Lib/unittest/async_case.py +146 -0
- package/python/Lib/unittest/case.py +1478 -0
- package/python/Lib/unittest/loader.py +460 -0
- package/python/Lib/unittest/main.py +280 -0
- package/python/Lib/unittest/mock.py +3189 -0
- package/python/Lib/unittest/result.py +256 -0
- package/python/Lib/unittest/runner.py +292 -0
- package/python/Lib/unittest/signals.py +71 -0
- package/python/Lib/unittest/suite.py +379 -0
- package/python/Lib/unittest/util.py +170 -0
- package/python/Lib/urllib/__init__.py +0 -0
- package/python/Lib/urllib/__pycache__/__init__.cpython-313.pyc +0 -0
- package/python/Lib/urllib/__pycache__/error.cpython-313.pyc +0 -0
- package/python/Lib/urllib/__pycache__/parse.cpython-313.pyc +0 -0
- package/python/Lib/urllib/__pycache__/request.cpython-313.pyc +0 -0
- package/python/Lib/urllib/__pycache__/response.cpython-313.pyc +0 -0
- package/python/Lib/urllib/error.py +74 -0
- package/python/Lib/urllib/parse.py +1264 -0
- package/python/Lib/urllib/request.py +2796 -0
- package/python/Lib/urllib/response.py +84 -0
- package/python/Lib/urllib/robotparser.py +363 -0
- package/python/Lib/uuid.py +784 -0
- package/python/Lib/warnings.py +735 -0
- package/python/Lib/wave.py +665 -0
- package/python/Lib/weakref.py +674 -0
- package/python/Lib/webbrowser.py +724 -0
- package/python/Lib/wsgiref/__init__.py +25 -0
- package/python/Lib/wsgiref/handlers.py +575 -0
- package/python/Lib/wsgiref/headers.py +192 -0
- package/python/Lib/wsgiref/simple_server.py +161 -0
- package/python/Lib/wsgiref/types.py +54 -0
- package/python/Lib/wsgiref/util.py +159 -0
- package/python/Lib/wsgiref/validate.py +438 -0
- package/python/Lib/xml/__init__.py +20 -0
- package/python/Lib/xml/__pycache__/__init__.cpython-313.pyc +0 -0
- package/python/Lib/xml/dom/NodeFilter.py +27 -0
- package/python/Lib/xml/dom/__init__.py +140 -0
- package/python/Lib/xml/dom/domreg.py +99 -0
- package/python/Lib/xml/dom/expatbuilder.py +962 -0
- package/python/Lib/xml/dom/minicompat.py +109 -0
- package/python/Lib/xml/dom/minidom.py +2024 -0
- package/python/Lib/xml/dom/pulldom.py +336 -0
- package/python/Lib/xml/dom/xmlbuilder.py +389 -0
- package/python/Lib/xml/etree/ElementInclude.py +186 -0
- package/python/Lib/xml/etree/ElementPath.py +430 -0
- package/python/Lib/xml/etree/ElementTree.py +2116 -0
- package/python/Lib/xml/etree/__init__.py +33 -0
- package/python/Lib/xml/etree/cElementTree.py +3 -0
- package/python/Lib/xml/parsers/__init__.py +8 -0
- package/python/Lib/xml/parsers/__pycache__/__init__.cpython-313.pyc +0 -0
- package/python/Lib/xml/parsers/__pycache__/expat.cpython-313.pyc +0 -0
- package/python/Lib/xml/parsers/expat.py +8 -0
- package/python/Lib/xml/sax/__init__.py +94 -0
- package/python/Lib/xml/sax/_exceptions.py +127 -0
- package/python/Lib/xml/sax/expatreader.py +454 -0
- package/python/Lib/xml/sax/handler.py +387 -0
- package/python/Lib/xml/sax/saxutils.py +369 -0
- package/python/Lib/xml/sax/xmlreader.py +378 -0
- package/python/Lib/xmlrpc/__init__.py +1 -0
- package/python/Lib/xmlrpc/__pycache__/__init__.cpython-313.pyc +0 -0
- package/python/Lib/xmlrpc/__pycache__/client.cpython-313.pyc +0 -0
- package/python/Lib/xmlrpc/client.py +1503 -0
- package/python/Lib/xmlrpc/server.py +1002 -0
- package/python/Lib/zipapp.py +229 -0
- package/python/Lib/zipfile/__init__.py +2391 -0
- package/python/Lib/zipfile/__main__.py +4 -0
- package/python/Lib/zipfile/__pycache__/__init__.cpython-313.pyc +0 -0
- package/python/Lib/zipfile/_path/__init__.py +452 -0
- package/python/Lib/zipfile/_path/__pycache__/__init__.cpython-313.pyc +0 -0
- package/python/Lib/zipfile/_path/__pycache__/glob.cpython-313.pyc +0 -0
- package/python/Lib/zipfile/_path/glob.py +113 -0
- package/python/Lib/zipimport.py +803 -0
- package/python/Lib/zoneinfo/__init__.py +34 -0
- package/python/Lib/zoneinfo/_common.py +172 -0
- package/python/Lib/zoneinfo/_tzpath.py +189 -0
- package/python/Lib/zoneinfo/_zoneinfo.py +779 -0
- package/python/licenses/LICENSE.bdb.txt +126 -0
- package/python/licenses/LICENSE.bzip2.txt +37 -0
- package/python/licenses/LICENSE.cpython.txt +771 -0
- package/python/licenses/LICENSE.expat.txt +21 -0
- package/python/licenses/LICENSE.libX11.txt +942 -0
- package/python/licenses/LICENSE.libXau.txt +21 -0
- package/python/licenses/LICENSE.libedit.txt +29 -0
- package/python/licenses/LICENSE.libffi.txt +21 -0
- package/python/licenses/LICENSE.liblzma.txt +13 -0
- package/python/licenses/LICENSE.libuuid.txt +27 -0
- package/python/licenses/LICENSE.libxcb.txt +30 -0
- package/python/licenses/LICENSE.mpdecimal.txt +24 -0
- package/python/licenses/LICENSE.ncurses.txt +29 -0
- package/python/licenses/LICENSE.openssl-1.1.txt +124 -0
- package/python/licenses/LICENSE.openssl-3.txt +177 -0
- package/python/licenses/LICENSE.sqlite.txt +23 -0
- package/python/licenses/LICENSE.tcl.txt +40 -0
- package/python/licenses/LICENSE.tix.txt +54 -0
- package/python/licenses/LICENSE.zlib.txt +21 -0
- package/python/python.exe +0 -0
- package/python/python3.dll +0 -0
- package/python/python313.dll +0 -0
- package/python/pythonw.exe +0 -0
- package/python/vcruntime140.dll +0 -0
- package/python/vcruntime140_1.dll +0 -0
|
@@ -0,0 +1,852 @@
|
|
|
1
|
+
# Copyright 2000-2010 Michael Hudson-Doyle <micahel@gmail.com>
|
|
2
|
+
# Antonio Cuni
|
|
3
|
+
# Armin Rigo
|
|
4
|
+
#
|
|
5
|
+
# All Rights Reserved
|
|
6
|
+
#
|
|
7
|
+
#
|
|
8
|
+
# Permission to use, copy, modify, and distribute this software and
|
|
9
|
+
# its documentation for any purpose is hereby granted without fee,
|
|
10
|
+
# provided that the above copyright notice appear in all copies and
|
|
11
|
+
# that both that copyright notice and this permission notice appear in
|
|
12
|
+
# supporting documentation.
|
|
13
|
+
#
|
|
14
|
+
# THE AUTHOR MICHAEL HUDSON DISCLAIMS ALL WARRANTIES WITH REGARD TO
|
|
15
|
+
# THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
16
|
+
# AND FITNESS, IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL,
|
|
17
|
+
# INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
|
|
18
|
+
# RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
|
|
19
|
+
# CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
|
|
20
|
+
# CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
21
|
+
|
|
22
|
+
from __future__ import annotations
|
|
23
|
+
|
|
24
|
+
import errno
|
|
25
|
+
import os
|
|
26
|
+
import re
|
|
27
|
+
import select
|
|
28
|
+
import signal
|
|
29
|
+
import struct
|
|
30
|
+
import termios
|
|
31
|
+
import time
|
|
32
|
+
import platform
|
|
33
|
+
from fcntl import ioctl
|
|
34
|
+
|
|
35
|
+
from . import curses
|
|
36
|
+
from .console import Console, Event
|
|
37
|
+
from .fancy_termios import tcgetattr, tcsetattr, TermState
|
|
38
|
+
from .trace import trace
|
|
39
|
+
from .unix_eventqueue import EventQueue
|
|
40
|
+
from .utils import wlen
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
TYPE_CHECKING = False
|
|
44
|
+
|
|
45
|
+
# types
|
|
46
|
+
if TYPE_CHECKING:
|
|
47
|
+
from typing import AbstractSet, IO, Literal, overload, cast
|
|
48
|
+
else:
|
|
49
|
+
overload = lambda func: None
|
|
50
|
+
cast = lambda typ, val: val
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
class InvalidTerminal(RuntimeError):
|
|
54
|
+
def __init__(self, message: str) -> None:
|
|
55
|
+
super().__init__(errno.EIO, message)
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
_error = (termios.error, curses.error, InvalidTerminal)
|
|
59
|
+
_error_codes_to_ignore = frozenset([errno.EIO, errno.ENXIO, errno.EPERM])
|
|
60
|
+
|
|
61
|
+
SIGWINCH_EVENT = "repaint"
|
|
62
|
+
|
|
63
|
+
FIONREAD = getattr(termios, "FIONREAD", None)
|
|
64
|
+
TIOCGWINSZ = getattr(termios, "TIOCGWINSZ", None)
|
|
65
|
+
|
|
66
|
+
# ------------ start of baudrate definitions ------------
|
|
67
|
+
|
|
68
|
+
# Add (possibly) missing baudrates (check termios man page) to termios
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
def add_baudrate_if_supported(dictionary: dict[int, int], rate: int) -> None:
|
|
72
|
+
baudrate_name = "B%d" % rate
|
|
73
|
+
if hasattr(termios, baudrate_name):
|
|
74
|
+
dictionary[getattr(termios, baudrate_name)] = rate
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
# Check the termios man page (Line speed) to know where these
|
|
78
|
+
# values come from.
|
|
79
|
+
potential_baudrates = [
|
|
80
|
+
0,
|
|
81
|
+
110,
|
|
82
|
+
115200,
|
|
83
|
+
1200,
|
|
84
|
+
134,
|
|
85
|
+
150,
|
|
86
|
+
1800,
|
|
87
|
+
19200,
|
|
88
|
+
200,
|
|
89
|
+
230400,
|
|
90
|
+
2400,
|
|
91
|
+
300,
|
|
92
|
+
38400,
|
|
93
|
+
460800,
|
|
94
|
+
4800,
|
|
95
|
+
50,
|
|
96
|
+
57600,
|
|
97
|
+
600,
|
|
98
|
+
75,
|
|
99
|
+
9600,
|
|
100
|
+
]
|
|
101
|
+
|
|
102
|
+
ratedict: dict[int, int] = {}
|
|
103
|
+
for rate in potential_baudrates:
|
|
104
|
+
add_baudrate_if_supported(ratedict, rate)
|
|
105
|
+
|
|
106
|
+
# Clean up variables to avoid unintended usage
|
|
107
|
+
del rate, add_baudrate_if_supported
|
|
108
|
+
|
|
109
|
+
# ------------ end of baudrate definitions ------------
|
|
110
|
+
|
|
111
|
+
delayprog = re.compile(b"\\$<([0-9]+)((?:/|\\*){0,2})>")
|
|
112
|
+
|
|
113
|
+
try:
|
|
114
|
+
poll: type[select.poll] = select.poll
|
|
115
|
+
except AttributeError:
|
|
116
|
+
# this is exactly the minumum necessary to support what we
|
|
117
|
+
# do with poll objects
|
|
118
|
+
class MinimalPoll:
|
|
119
|
+
def __init__(self):
|
|
120
|
+
pass
|
|
121
|
+
|
|
122
|
+
def register(self, fd, flag):
|
|
123
|
+
self.fd = fd
|
|
124
|
+
|
|
125
|
+
# note: The 'timeout' argument is received as *milliseconds*
|
|
126
|
+
def poll(self, timeout: float | None = None) -> list[int]:
|
|
127
|
+
if timeout is None:
|
|
128
|
+
r, w, e = select.select([self.fd], [], [])
|
|
129
|
+
else:
|
|
130
|
+
r, w, e = select.select([self.fd], [], [], timeout / 1000)
|
|
131
|
+
return r
|
|
132
|
+
|
|
133
|
+
poll = MinimalPoll # type: ignore[assignment]
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
class UnixConsole(Console):
|
|
137
|
+
def __init__(
|
|
138
|
+
self,
|
|
139
|
+
f_in: IO[bytes] | int = 0,
|
|
140
|
+
f_out: IO[bytes] | int = 1,
|
|
141
|
+
term: str = "",
|
|
142
|
+
encoding: str = "",
|
|
143
|
+
):
|
|
144
|
+
"""
|
|
145
|
+
Initialize the UnixConsole.
|
|
146
|
+
|
|
147
|
+
Parameters:
|
|
148
|
+
- f_in (int or file-like object): Input file descriptor or object.
|
|
149
|
+
- f_out (int or file-like object): Output file descriptor or object.
|
|
150
|
+
- term (str): Terminal name.
|
|
151
|
+
- encoding (str): Encoding to use for I/O operations.
|
|
152
|
+
"""
|
|
153
|
+
super().__init__(f_in, f_out, term, encoding)
|
|
154
|
+
|
|
155
|
+
self.pollob = poll()
|
|
156
|
+
self.pollob.register(self.input_fd, select.POLLIN)
|
|
157
|
+
self.input_buffer = b""
|
|
158
|
+
self.input_buffer_pos = 0
|
|
159
|
+
curses.setupterm(term or None, self.output_fd)
|
|
160
|
+
self.term = term
|
|
161
|
+
self.is_apple_terminal = (
|
|
162
|
+
platform.system() == "Darwin"
|
|
163
|
+
and os.getenv("TERM_PROGRAM") == "Apple_Terminal"
|
|
164
|
+
)
|
|
165
|
+
|
|
166
|
+
try:
|
|
167
|
+
self.__input_fd_set(tcgetattr(self.input_fd), ignore=frozenset())
|
|
168
|
+
except _error as e:
|
|
169
|
+
raise RuntimeError(f"termios failure ({e.args[1]})")
|
|
170
|
+
|
|
171
|
+
@overload
|
|
172
|
+
def _my_getstr(
|
|
173
|
+
cap: str, optional: Literal[False] = False
|
|
174
|
+
) -> bytes: ...
|
|
175
|
+
|
|
176
|
+
@overload
|
|
177
|
+
def _my_getstr(cap: str, optional: bool) -> bytes | None: ...
|
|
178
|
+
|
|
179
|
+
def _my_getstr(cap: str, optional: bool = False) -> bytes | None:
|
|
180
|
+
r = curses.tigetstr(cap)
|
|
181
|
+
if not optional and r is None:
|
|
182
|
+
raise InvalidTerminal(
|
|
183
|
+
f"terminal doesn't have the required {cap} capability"
|
|
184
|
+
)
|
|
185
|
+
return r
|
|
186
|
+
|
|
187
|
+
self._bel = _my_getstr("bel")
|
|
188
|
+
self._civis = _my_getstr("civis", optional=True)
|
|
189
|
+
self._clear = _my_getstr("clear")
|
|
190
|
+
self._cnorm = _my_getstr("cnorm", optional=True)
|
|
191
|
+
self._cub = _my_getstr("cub", optional=True)
|
|
192
|
+
self._cub1 = _my_getstr("cub1", optional=True)
|
|
193
|
+
self._cud = _my_getstr("cud", optional=True)
|
|
194
|
+
self._cud1 = _my_getstr("cud1", optional=True)
|
|
195
|
+
self._cuf = _my_getstr("cuf", optional=True)
|
|
196
|
+
self._cuf1 = _my_getstr("cuf1", optional=True)
|
|
197
|
+
self._cup = _my_getstr("cup")
|
|
198
|
+
self._cuu = _my_getstr("cuu", optional=True)
|
|
199
|
+
self._cuu1 = _my_getstr("cuu1", optional=True)
|
|
200
|
+
self._dch1 = _my_getstr("dch1", optional=True)
|
|
201
|
+
self._dch = _my_getstr("dch", optional=True)
|
|
202
|
+
self._el = _my_getstr("el")
|
|
203
|
+
self._hpa = _my_getstr("hpa", optional=True)
|
|
204
|
+
self._ich = _my_getstr("ich", optional=True)
|
|
205
|
+
self._ich1 = _my_getstr("ich1", optional=True)
|
|
206
|
+
self._ind = _my_getstr("ind", optional=True)
|
|
207
|
+
self._pad = _my_getstr("pad", optional=True)
|
|
208
|
+
self._ri = _my_getstr("ri", optional=True)
|
|
209
|
+
self._rmkx = _my_getstr("rmkx", optional=True)
|
|
210
|
+
self._smkx = _my_getstr("smkx", optional=True)
|
|
211
|
+
|
|
212
|
+
self.__setup_movement()
|
|
213
|
+
|
|
214
|
+
self.event_queue = EventQueue(self.input_fd, self.encoding)
|
|
215
|
+
self.cursor_visible = 1
|
|
216
|
+
|
|
217
|
+
signal.signal(signal.SIGCONT, self._sigcont_handler)
|
|
218
|
+
|
|
219
|
+
def _sigcont_handler(self, signum, frame):
|
|
220
|
+
self.restore()
|
|
221
|
+
self.prepare()
|
|
222
|
+
|
|
223
|
+
def more_in_buffer(self) -> bool:
|
|
224
|
+
return bool(
|
|
225
|
+
self.input_buffer
|
|
226
|
+
and self.input_buffer_pos < len(self.input_buffer)
|
|
227
|
+
)
|
|
228
|
+
|
|
229
|
+
def __read(self, n: int) -> bytes:
|
|
230
|
+
if not self.more_in_buffer():
|
|
231
|
+
self.input_buffer = os.read(self.input_fd, 10000)
|
|
232
|
+
|
|
233
|
+
ret = self.input_buffer[self.input_buffer_pos : self.input_buffer_pos + n]
|
|
234
|
+
self.input_buffer_pos += len(ret)
|
|
235
|
+
if self.input_buffer_pos >= len(self.input_buffer):
|
|
236
|
+
self.input_buffer = b""
|
|
237
|
+
self.input_buffer_pos = 0
|
|
238
|
+
return ret
|
|
239
|
+
|
|
240
|
+
def change_encoding(self, encoding: str) -> None:
|
|
241
|
+
"""
|
|
242
|
+
Change the encoding used for I/O operations.
|
|
243
|
+
|
|
244
|
+
Parameters:
|
|
245
|
+
- encoding (str): New encoding to use.
|
|
246
|
+
"""
|
|
247
|
+
self.encoding = encoding
|
|
248
|
+
|
|
249
|
+
def refresh(self, screen, c_xy):
|
|
250
|
+
"""
|
|
251
|
+
Refresh the console screen.
|
|
252
|
+
|
|
253
|
+
Parameters:
|
|
254
|
+
- screen (list): List of strings representing the screen contents.
|
|
255
|
+
- c_xy (tuple): Cursor position (x, y) on the screen.
|
|
256
|
+
"""
|
|
257
|
+
cx, cy = c_xy
|
|
258
|
+
if not self.__gone_tall:
|
|
259
|
+
while len(self.screen) < min(len(screen), self.height):
|
|
260
|
+
self.__hide_cursor()
|
|
261
|
+
if self.screen:
|
|
262
|
+
self.__move(0, len(self.screen) - 1)
|
|
263
|
+
self.__write("\n")
|
|
264
|
+
self.posxy = 0, len(self.screen)
|
|
265
|
+
self.screen.append("")
|
|
266
|
+
else:
|
|
267
|
+
while len(self.screen) < len(screen):
|
|
268
|
+
self.screen.append("")
|
|
269
|
+
|
|
270
|
+
if len(screen) > self.height:
|
|
271
|
+
self.__gone_tall = 1
|
|
272
|
+
self.__move = self.__move_tall
|
|
273
|
+
|
|
274
|
+
px, py = self.posxy
|
|
275
|
+
old_offset = offset = self.__offset
|
|
276
|
+
height = self.height
|
|
277
|
+
|
|
278
|
+
# we make sure the cursor is on the screen, and that we're
|
|
279
|
+
# using all of the screen if we can
|
|
280
|
+
if cy < offset:
|
|
281
|
+
offset = cy
|
|
282
|
+
elif cy >= offset + height:
|
|
283
|
+
offset = cy - height + 1
|
|
284
|
+
elif offset > 0 and len(screen) < offset + height:
|
|
285
|
+
offset = max(len(screen) - height, 0)
|
|
286
|
+
screen.append("")
|
|
287
|
+
|
|
288
|
+
oldscr = self.screen[old_offset : old_offset + height]
|
|
289
|
+
newscr = screen[offset : offset + height]
|
|
290
|
+
|
|
291
|
+
# use hardware scrolling if we have it.
|
|
292
|
+
if old_offset > offset and self._ri:
|
|
293
|
+
self.__hide_cursor()
|
|
294
|
+
self.__write_code(self._cup, 0, 0)
|
|
295
|
+
self.posxy = 0, old_offset
|
|
296
|
+
for i in range(old_offset - offset):
|
|
297
|
+
self.__write_code(self._ri)
|
|
298
|
+
oldscr.pop(-1)
|
|
299
|
+
oldscr.insert(0, "")
|
|
300
|
+
elif old_offset < offset and self._ind:
|
|
301
|
+
self.__hide_cursor()
|
|
302
|
+
self.__write_code(self._cup, self.height - 1, 0)
|
|
303
|
+
self.posxy = 0, old_offset + self.height - 1
|
|
304
|
+
for i in range(offset - old_offset):
|
|
305
|
+
self.__write_code(self._ind)
|
|
306
|
+
oldscr.pop(0)
|
|
307
|
+
oldscr.append("")
|
|
308
|
+
|
|
309
|
+
self.__offset = offset
|
|
310
|
+
|
|
311
|
+
for (
|
|
312
|
+
y,
|
|
313
|
+
oldline,
|
|
314
|
+
newline,
|
|
315
|
+
) in zip(range(offset, offset + height), oldscr, newscr):
|
|
316
|
+
if oldline != newline:
|
|
317
|
+
self.__write_changed_line(y, oldline, newline, px)
|
|
318
|
+
|
|
319
|
+
y = len(newscr)
|
|
320
|
+
while y < len(oldscr):
|
|
321
|
+
self.__hide_cursor()
|
|
322
|
+
self.__move(0, y)
|
|
323
|
+
self.posxy = 0, y
|
|
324
|
+
self.__write_code(self._el)
|
|
325
|
+
y += 1
|
|
326
|
+
|
|
327
|
+
self.__show_cursor()
|
|
328
|
+
|
|
329
|
+
self.screen = screen.copy()
|
|
330
|
+
self.move_cursor(cx, cy)
|
|
331
|
+
self.flushoutput()
|
|
332
|
+
|
|
333
|
+
def move_cursor(self, x, y):
|
|
334
|
+
"""
|
|
335
|
+
Move the cursor to the specified position on the screen.
|
|
336
|
+
|
|
337
|
+
Parameters:
|
|
338
|
+
- x (int): X coordinate.
|
|
339
|
+
- y (int): Y coordinate.
|
|
340
|
+
"""
|
|
341
|
+
if y < self.__offset or y >= self.__offset + self.height:
|
|
342
|
+
self.event_queue.insert(Event("scroll", None))
|
|
343
|
+
else:
|
|
344
|
+
self.__move(x, y)
|
|
345
|
+
self.posxy = x, y
|
|
346
|
+
self.flushoutput()
|
|
347
|
+
|
|
348
|
+
def prepare(self):
|
|
349
|
+
"""
|
|
350
|
+
Prepare the console for input/output operations.
|
|
351
|
+
"""
|
|
352
|
+
self.__buffer = []
|
|
353
|
+
|
|
354
|
+
self.__svtermstate = tcgetattr(self.input_fd)
|
|
355
|
+
raw = self.__svtermstate.copy()
|
|
356
|
+
raw.iflag &= ~(termios.INPCK | termios.ISTRIP | termios.IXON)
|
|
357
|
+
raw.oflag &= ~(termios.OPOST)
|
|
358
|
+
raw.cflag &= ~(termios.CSIZE | termios.PARENB)
|
|
359
|
+
raw.cflag |= termios.CS8
|
|
360
|
+
raw.iflag |= termios.BRKINT
|
|
361
|
+
raw.lflag &= ~(termios.ICANON | termios.ECHO | termios.IEXTEN)
|
|
362
|
+
raw.lflag |= termios.ISIG
|
|
363
|
+
raw.cc[termios.VMIN] = 1
|
|
364
|
+
raw.cc[termios.VTIME] = 0
|
|
365
|
+
self.__input_fd_set(raw)
|
|
366
|
+
|
|
367
|
+
# In macOS terminal we need to deactivate line wrap via ANSI escape code
|
|
368
|
+
if self.is_apple_terminal:
|
|
369
|
+
os.write(self.output_fd, b"\033[?7l")
|
|
370
|
+
|
|
371
|
+
self.screen = []
|
|
372
|
+
self.height, self.width = self.getheightwidth()
|
|
373
|
+
|
|
374
|
+
self.posxy = 0, 0
|
|
375
|
+
self.__gone_tall = 0
|
|
376
|
+
self.__move = self.__move_short
|
|
377
|
+
self.__offset = 0
|
|
378
|
+
|
|
379
|
+
self.__maybe_write_code(self._smkx)
|
|
380
|
+
|
|
381
|
+
try:
|
|
382
|
+
self.old_sigwinch = signal.signal(signal.SIGWINCH, self.__sigwinch)
|
|
383
|
+
except ValueError:
|
|
384
|
+
pass
|
|
385
|
+
|
|
386
|
+
self.__enable_bracketed_paste()
|
|
387
|
+
|
|
388
|
+
def restore(self):
|
|
389
|
+
"""
|
|
390
|
+
Restore the console to the default state
|
|
391
|
+
"""
|
|
392
|
+
self.__disable_bracketed_paste()
|
|
393
|
+
self.__maybe_write_code(self._rmkx)
|
|
394
|
+
self.flushoutput()
|
|
395
|
+
self.__input_fd_set(self.__svtermstate)
|
|
396
|
+
|
|
397
|
+
if self.is_apple_terminal:
|
|
398
|
+
os.write(self.output_fd, b"\033[?7h")
|
|
399
|
+
|
|
400
|
+
if hasattr(self, "old_sigwinch"):
|
|
401
|
+
try:
|
|
402
|
+
signal.signal(signal.SIGWINCH, self.old_sigwinch)
|
|
403
|
+
except ValueError as e:
|
|
404
|
+
import threading
|
|
405
|
+
if threading.current_thread() is threading.main_thread():
|
|
406
|
+
raise e
|
|
407
|
+
del self.old_sigwinch
|
|
408
|
+
|
|
409
|
+
def push_char(self, char: int | bytes) -> None:
|
|
410
|
+
"""
|
|
411
|
+
Push a character to the console event queue.
|
|
412
|
+
"""
|
|
413
|
+
trace("push char {char!r}", char=char)
|
|
414
|
+
self.event_queue.push(char)
|
|
415
|
+
|
|
416
|
+
def get_event(self, block: bool = True) -> Event | None:
|
|
417
|
+
"""
|
|
418
|
+
Get an event from the console event queue.
|
|
419
|
+
|
|
420
|
+
Parameters:
|
|
421
|
+
- block (bool): Whether to block until an event is available.
|
|
422
|
+
|
|
423
|
+
Returns:
|
|
424
|
+
- Event: Event object from the event queue.
|
|
425
|
+
"""
|
|
426
|
+
if not block and not self.wait(timeout=0):
|
|
427
|
+
return None
|
|
428
|
+
|
|
429
|
+
while self.event_queue.empty():
|
|
430
|
+
while True:
|
|
431
|
+
try:
|
|
432
|
+
self.push_char(self.__read(1))
|
|
433
|
+
except OSError as err:
|
|
434
|
+
if err.errno == errno.EINTR:
|
|
435
|
+
if not self.event_queue.empty():
|
|
436
|
+
return self.event_queue.get()
|
|
437
|
+
else:
|
|
438
|
+
continue
|
|
439
|
+
elif err.errno == errno.EIO:
|
|
440
|
+
raise SystemExit(errno.EIO)
|
|
441
|
+
else:
|
|
442
|
+
raise
|
|
443
|
+
else:
|
|
444
|
+
break
|
|
445
|
+
return self.event_queue.get()
|
|
446
|
+
|
|
447
|
+
def wait(self, timeout: float | None = None) -> bool:
|
|
448
|
+
"""
|
|
449
|
+
Wait for events on the console.
|
|
450
|
+
"""
|
|
451
|
+
return (
|
|
452
|
+
not self.event_queue.empty()
|
|
453
|
+
or self.more_in_buffer()
|
|
454
|
+
or bool(self.pollob.poll(timeout))
|
|
455
|
+
)
|
|
456
|
+
|
|
457
|
+
def set_cursor_vis(self, visible):
|
|
458
|
+
"""
|
|
459
|
+
Set the visibility of the cursor.
|
|
460
|
+
|
|
461
|
+
Parameters:
|
|
462
|
+
- visible (bool): Visibility flag.
|
|
463
|
+
"""
|
|
464
|
+
if visible:
|
|
465
|
+
self.__show_cursor()
|
|
466
|
+
else:
|
|
467
|
+
self.__hide_cursor()
|
|
468
|
+
|
|
469
|
+
if TIOCGWINSZ:
|
|
470
|
+
|
|
471
|
+
def getheightwidth(self):
|
|
472
|
+
"""
|
|
473
|
+
Get the height and width of the console.
|
|
474
|
+
|
|
475
|
+
Returns:
|
|
476
|
+
- tuple: Height and width of the console.
|
|
477
|
+
"""
|
|
478
|
+
try:
|
|
479
|
+
return int(os.environ["LINES"]), int(os.environ["COLUMNS"])
|
|
480
|
+
except (KeyError, TypeError, ValueError):
|
|
481
|
+
try:
|
|
482
|
+
size = ioctl(self.input_fd, TIOCGWINSZ, b"\000" * 8)
|
|
483
|
+
except OSError:
|
|
484
|
+
return 25, 80
|
|
485
|
+
height, width = struct.unpack("hhhh", size)[0:2]
|
|
486
|
+
if not height:
|
|
487
|
+
return 25, 80
|
|
488
|
+
return height, width
|
|
489
|
+
|
|
490
|
+
else:
|
|
491
|
+
|
|
492
|
+
def getheightwidth(self):
|
|
493
|
+
"""
|
|
494
|
+
Get the height and width of the console.
|
|
495
|
+
|
|
496
|
+
Returns:
|
|
497
|
+
- tuple: Height and width of the console.
|
|
498
|
+
"""
|
|
499
|
+
try:
|
|
500
|
+
return int(os.environ["LINES"]), int(os.environ["COLUMNS"])
|
|
501
|
+
except (KeyError, TypeError, ValueError):
|
|
502
|
+
return 25, 80
|
|
503
|
+
|
|
504
|
+
def forgetinput(self):
|
|
505
|
+
"""
|
|
506
|
+
Discard any pending input on the console.
|
|
507
|
+
"""
|
|
508
|
+
termios.tcflush(self.input_fd, termios.TCIFLUSH)
|
|
509
|
+
|
|
510
|
+
def flushoutput(self):
|
|
511
|
+
"""
|
|
512
|
+
Flush the output buffer.
|
|
513
|
+
"""
|
|
514
|
+
for text, iscode in self.__buffer:
|
|
515
|
+
if iscode:
|
|
516
|
+
self.__tputs(text)
|
|
517
|
+
else:
|
|
518
|
+
os.write(self.output_fd, text.encode(self.encoding, "replace"))
|
|
519
|
+
del self.__buffer[:]
|
|
520
|
+
|
|
521
|
+
def finish(self):
|
|
522
|
+
"""
|
|
523
|
+
Finish console operations and flush the output buffer.
|
|
524
|
+
"""
|
|
525
|
+
y = len(self.screen) - 1
|
|
526
|
+
while y >= 0 and not self.screen[y]:
|
|
527
|
+
y -= 1
|
|
528
|
+
self.__move(0, min(y, self.height + self.__offset - 1))
|
|
529
|
+
self.__write("\n\r")
|
|
530
|
+
self.flushoutput()
|
|
531
|
+
|
|
532
|
+
def beep(self):
|
|
533
|
+
"""
|
|
534
|
+
Emit a beep sound.
|
|
535
|
+
"""
|
|
536
|
+
self.__maybe_write_code(self._bel)
|
|
537
|
+
self.flushoutput()
|
|
538
|
+
|
|
539
|
+
if FIONREAD:
|
|
540
|
+
|
|
541
|
+
def getpending(self):
|
|
542
|
+
"""
|
|
543
|
+
Get pending events from the console event queue.
|
|
544
|
+
|
|
545
|
+
Returns:
|
|
546
|
+
- Event: Pending event from the event queue.
|
|
547
|
+
"""
|
|
548
|
+
e = Event("key", "", b"")
|
|
549
|
+
|
|
550
|
+
while not self.event_queue.empty():
|
|
551
|
+
e2 = self.event_queue.get()
|
|
552
|
+
e.data += e2.data
|
|
553
|
+
e.raw += e.raw
|
|
554
|
+
|
|
555
|
+
amount = struct.unpack("i", ioctl(self.input_fd, FIONREAD, b"\0\0\0\0"))[0]
|
|
556
|
+
raw = self.__read(amount)
|
|
557
|
+
data = str(raw, self.encoding, "replace")
|
|
558
|
+
e.data += data
|
|
559
|
+
e.raw += raw
|
|
560
|
+
return e
|
|
561
|
+
|
|
562
|
+
else:
|
|
563
|
+
|
|
564
|
+
def getpending(self):
|
|
565
|
+
"""
|
|
566
|
+
Get pending events from the console event queue.
|
|
567
|
+
|
|
568
|
+
Returns:
|
|
569
|
+
- Event: Pending event from the event queue.
|
|
570
|
+
"""
|
|
571
|
+
e = Event("key", "", b"")
|
|
572
|
+
|
|
573
|
+
while not self.event_queue.empty():
|
|
574
|
+
e2 = self.event_queue.get()
|
|
575
|
+
e.data += e2.data
|
|
576
|
+
e.raw += e.raw
|
|
577
|
+
|
|
578
|
+
amount = 10000
|
|
579
|
+
raw = self.__read(amount)
|
|
580
|
+
data = str(raw, self.encoding, "replace")
|
|
581
|
+
e.data += data
|
|
582
|
+
e.raw += raw
|
|
583
|
+
return e
|
|
584
|
+
|
|
585
|
+
def clear(self):
|
|
586
|
+
"""
|
|
587
|
+
Clear the console screen.
|
|
588
|
+
"""
|
|
589
|
+
self.__write_code(self._clear)
|
|
590
|
+
self.__gone_tall = 1
|
|
591
|
+
self.__move = self.__move_tall
|
|
592
|
+
self.posxy = 0, 0
|
|
593
|
+
self.screen = []
|
|
594
|
+
|
|
595
|
+
@property
|
|
596
|
+
def input_hook(self):
|
|
597
|
+
try:
|
|
598
|
+
import posix
|
|
599
|
+
except ImportError:
|
|
600
|
+
return None
|
|
601
|
+
if posix._is_inputhook_installed():
|
|
602
|
+
return posix._inputhook
|
|
603
|
+
|
|
604
|
+
def __enable_bracketed_paste(self) -> None:
|
|
605
|
+
os.write(self.output_fd, b"\x1b[?2004h")
|
|
606
|
+
|
|
607
|
+
def __disable_bracketed_paste(self) -> None:
|
|
608
|
+
os.write(self.output_fd, b"\x1b[?2004l")
|
|
609
|
+
|
|
610
|
+
def __setup_movement(self):
|
|
611
|
+
"""
|
|
612
|
+
Set up the movement functions based on the terminal capabilities.
|
|
613
|
+
"""
|
|
614
|
+
if 0 and self._hpa: # hpa don't work in windows telnet :-(
|
|
615
|
+
self.__move_x = self.__move_x_hpa
|
|
616
|
+
elif self._cub and self._cuf:
|
|
617
|
+
self.__move_x = self.__move_x_cub_cuf
|
|
618
|
+
elif self._cub1 and self._cuf1:
|
|
619
|
+
self.__move_x = self.__move_x_cub1_cuf1
|
|
620
|
+
else:
|
|
621
|
+
raise RuntimeError("insufficient terminal (horizontal)")
|
|
622
|
+
|
|
623
|
+
if self._cuu and self._cud:
|
|
624
|
+
self.__move_y = self.__move_y_cuu_cud
|
|
625
|
+
elif self._cuu1 and self._cud1:
|
|
626
|
+
self.__move_y = self.__move_y_cuu1_cud1
|
|
627
|
+
else:
|
|
628
|
+
raise RuntimeError("insufficient terminal (vertical)")
|
|
629
|
+
|
|
630
|
+
if self._dch1:
|
|
631
|
+
self.dch1 = self._dch1
|
|
632
|
+
elif self._dch:
|
|
633
|
+
self.dch1 = curses.tparm(self._dch, 1)
|
|
634
|
+
else:
|
|
635
|
+
self.dch1 = None
|
|
636
|
+
|
|
637
|
+
if self._ich1:
|
|
638
|
+
self.ich1 = self._ich1
|
|
639
|
+
elif self._ich:
|
|
640
|
+
self.ich1 = curses.tparm(self._ich, 1)
|
|
641
|
+
else:
|
|
642
|
+
self.ich1 = None
|
|
643
|
+
|
|
644
|
+
self.__move = self.__move_short
|
|
645
|
+
|
|
646
|
+
def __write_changed_line(self, y, oldline, newline, px_coord):
|
|
647
|
+
# this is frustrating; there's no reason to test (say)
|
|
648
|
+
# self.dch1 inside the loop -- but alternative ways of
|
|
649
|
+
# structuring this function are equally painful (I'm trying to
|
|
650
|
+
# avoid writing code generators these days...)
|
|
651
|
+
minlen = min(wlen(oldline), wlen(newline))
|
|
652
|
+
x_pos = 0
|
|
653
|
+
x_coord = 0
|
|
654
|
+
|
|
655
|
+
px_pos = 0
|
|
656
|
+
j = 0
|
|
657
|
+
for c in oldline:
|
|
658
|
+
if j >= px_coord:
|
|
659
|
+
break
|
|
660
|
+
j += wlen(c)
|
|
661
|
+
px_pos += 1
|
|
662
|
+
|
|
663
|
+
# reuse the oldline as much as possible, but stop as soon as we
|
|
664
|
+
# encounter an ESCAPE, because it might be the start of an escape
|
|
665
|
+
# sequene
|
|
666
|
+
while (
|
|
667
|
+
x_coord < minlen
|
|
668
|
+
and oldline[x_pos] == newline[x_pos]
|
|
669
|
+
and newline[x_pos] != "\x1b"
|
|
670
|
+
):
|
|
671
|
+
x_coord += wlen(newline[x_pos])
|
|
672
|
+
x_pos += 1
|
|
673
|
+
|
|
674
|
+
# if we need to insert a single character right after the first detected change
|
|
675
|
+
if oldline[x_pos:] == newline[x_pos + 1 :] and self.ich1:
|
|
676
|
+
if (
|
|
677
|
+
y == self.posxy[1]
|
|
678
|
+
and x_coord > self.posxy[0]
|
|
679
|
+
and oldline[px_pos:x_pos] == newline[px_pos + 1 : x_pos + 1]
|
|
680
|
+
):
|
|
681
|
+
x_pos = px_pos
|
|
682
|
+
x_coord = px_coord
|
|
683
|
+
character_width = wlen(newline[x_pos])
|
|
684
|
+
self.__move(x_coord, y)
|
|
685
|
+
self.__write_code(self.ich1)
|
|
686
|
+
self.__write(newline[x_pos])
|
|
687
|
+
self.posxy = x_coord + character_width, y
|
|
688
|
+
|
|
689
|
+
# if it's a single character change in the middle of the line
|
|
690
|
+
elif (
|
|
691
|
+
x_coord < minlen
|
|
692
|
+
and oldline[x_pos + 1 :] == newline[x_pos + 1 :]
|
|
693
|
+
and wlen(oldline[x_pos]) == wlen(newline[x_pos])
|
|
694
|
+
):
|
|
695
|
+
character_width = wlen(newline[x_pos])
|
|
696
|
+
self.__move(x_coord, y)
|
|
697
|
+
self.__write(newline[x_pos])
|
|
698
|
+
self.posxy = x_coord + character_width, y
|
|
699
|
+
|
|
700
|
+
# if this is the last character to fit in the line and we edit in the middle of the line
|
|
701
|
+
elif (
|
|
702
|
+
self.dch1
|
|
703
|
+
and self.ich1
|
|
704
|
+
and wlen(newline) == self.width
|
|
705
|
+
and x_coord < wlen(newline) - 2
|
|
706
|
+
and newline[x_pos + 1 : -1] == oldline[x_pos:-2]
|
|
707
|
+
):
|
|
708
|
+
self.__hide_cursor()
|
|
709
|
+
self.__move(self.width - 2, y)
|
|
710
|
+
self.posxy = self.width - 2, y
|
|
711
|
+
self.__write_code(self.dch1)
|
|
712
|
+
|
|
713
|
+
character_width = wlen(newline[x_pos])
|
|
714
|
+
self.__move(x_coord, y)
|
|
715
|
+
self.__write_code(self.ich1)
|
|
716
|
+
self.__write(newline[x_pos])
|
|
717
|
+
self.posxy = character_width + 1, y
|
|
718
|
+
|
|
719
|
+
else:
|
|
720
|
+
self.__hide_cursor()
|
|
721
|
+
self.__move(x_coord, y)
|
|
722
|
+
if wlen(oldline) > wlen(newline):
|
|
723
|
+
self.__write_code(self._el)
|
|
724
|
+
self.__write(newline[x_pos:])
|
|
725
|
+
self.posxy = wlen(newline), y
|
|
726
|
+
|
|
727
|
+
if "\x1b" in newline:
|
|
728
|
+
# ANSI escape characters are present, so we can't assume
|
|
729
|
+
# anything about the position of the cursor. Moving the cursor
|
|
730
|
+
# to the left margin should work to get to a known position.
|
|
731
|
+
self.move_cursor(0, y)
|
|
732
|
+
|
|
733
|
+
def __write(self, text):
|
|
734
|
+
self.__buffer.append((text, 0))
|
|
735
|
+
|
|
736
|
+
def __write_code(self, fmt, *args):
|
|
737
|
+
self.__buffer.append((curses.tparm(fmt, *args), 1))
|
|
738
|
+
|
|
739
|
+
def __maybe_write_code(self, fmt, *args):
|
|
740
|
+
if fmt:
|
|
741
|
+
self.__write_code(fmt, *args)
|
|
742
|
+
|
|
743
|
+
def __move_y_cuu1_cud1(self, y):
|
|
744
|
+
assert self._cud1 is not None
|
|
745
|
+
assert self._cuu1 is not None
|
|
746
|
+
dy = y - self.posxy[1]
|
|
747
|
+
if dy > 0:
|
|
748
|
+
self.__write_code(dy * self._cud1)
|
|
749
|
+
elif dy < 0:
|
|
750
|
+
self.__write_code((-dy) * self._cuu1)
|
|
751
|
+
|
|
752
|
+
def __move_y_cuu_cud(self, y):
|
|
753
|
+
dy = y - self.posxy[1]
|
|
754
|
+
if dy > 0:
|
|
755
|
+
self.__write_code(self._cud, dy)
|
|
756
|
+
elif dy < 0:
|
|
757
|
+
self.__write_code(self._cuu, -dy)
|
|
758
|
+
|
|
759
|
+
def __move_x_hpa(self, x: int) -> None:
|
|
760
|
+
if x != self.posxy[0]:
|
|
761
|
+
self.__write_code(self._hpa, x)
|
|
762
|
+
|
|
763
|
+
def __move_x_cub1_cuf1(self, x: int) -> None:
|
|
764
|
+
assert self._cuf1 is not None
|
|
765
|
+
assert self._cub1 is not None
|
|
766
|
+
dx = x - self.posxy[0]
|
|
767
|
+
if dx > 0:
|
|
768
|
+
self.__write_code(self._cuf1 * dx)
|
|
769
|
+
elif dx < 0:
|
|
770
|
+
self.__write_code(self._cub1 * (-dx))
|
|
771
|
+
|
|
772
|
+
def __move_x_cub_cuf(self, x: int) -> None:
|
|
773
|
+
dx = x - self.posxy[0]
|
|
774
|
+
if dx > 0:
|
|
775
|
+
self.__write_code(self._cuf, dx)
|
|
776
|
+
elif dx < 0:
|
|
777
|
+
self.__write_code(self._cub, -dx)
|
|
778
|
+
|
|
779
|
+
def __move_short(self, x, y):
|
|
780
|
+
self.__move_x(x)
|
|
781
|
+
self.__move_y(y)
|
|
782
|
+
|
|
783
|
+
def __move_tall(self, x, y):
|
|
784
|
+
assert 0 <= y - self.__offset < self.height, y - self.__offset
|
|
785
|
+
self.__write_code(self._cup, y - self.__offset, x)
|
|
786
|
+
|
|
787
|
+
def __sigwinch(self, signum, frame):
|
|
788
|
+
self.height, self.width = self.getheightwidth()
|
|
789
|
+
self.event_queue.insert(Event("resize", None))
|
|
790
|
+
|
|
791
|
+
def __hide_cursor(self):
|
|
792
|
+
if self.cursor_visible:
|
|
793
|
+
self.__maybe_write_code(self._civis)
|
|
794
|
+
self.cursor_visible = 0
|
|
795
|
+
|
|
796
|
+
def __show_cursor(self):
|
|
797
|
+
if not self.cursor_visible:
|
|
798
|
+
self.__maybe_write_code(self._cnorm)
|
|
799
|
+
self.cursor_visible = 1
|
|
800
|
+
|
|
801
|
+
def repaint(self):
|
|
802
|
+
if not self.__gone_tall:
|
|
803
|
+
self.posxy = 0, self.posxy[1]
|
|
804
|
+
self.__write("\r")
|
|
805
|
+
ns = len(self.screen) * ["\000" * self.width]
|
|
806
|
+
self.screen = ns
|
|
807
|
+
else:
|
|
808
|
+
self.posxy = 0, self.__offset
|
|
809
|
+
self.__move(0, self.__offset)
|
|
810
|
+
ns = self.height * ["\000" * self.width]
|
|
811
|
+
self.screen = ns
|
|
812
|
+
|
|
813
|
+
def __tputs(self, fmt, prog=delayprog):
|
|
814
|
+
"""A Python implementation of the curses tputs function; the
|
|
815
|
+
curses one can't really be wrapped in a sane manner.
|
|
816
|
+
|
|
817
|
+
I have the strong suspicion that this is complexity that
|
|
818
|
+
will never do anyone any good."""
|
|
819
|
+
# using .get() means that things will blow up
|
|
820
|
+
# only if the bps is actually needed (which I'm
|
|
821
|
+
# betting is pretty unlikely)
|
|
822
|
+
bps = ratedict.get(self.__svtermstate.ospeed)
|
|
823
|
+
while 1:
|
|
824
|
+
m = prog.search(fmt)
|
|
825
|
+
if not m:
|
|
826
|
+
os.write(self.output_fd, fmt)
|
|
827
|
+
break
|
|
828
|
+
x, y = m.span()
|
|
829
|
+
os.write(self.output_fd, fmt[:x])
|
|
830
|
+
fmt = fmt[y:]
|
|
831
|
+
delay = int(m.group(1))
|
|
832
|
+
if b"*" in m.group(2):
|
|
833
|
+
delay *= self.height
|
|
834
|
+
if self._pad and bps is not None:
|
|
835
|
+
nchars = (bps * delay) / 1000
|
|
836
|
+
os.write(self.output_fd, self._pad * nchars)
|
|
837
|
+
else:
|
|
838
|
+
time.sleep(float(delay) / 1000.0)
|
|
839
|
+
|
|
840
|
+
def __input_fd_set(
|
|
841
|
+
self,
|
|
842
|
+
state: TermState,
|
|
843
|
+
ignore: AbstractSet[int] = _error_codes_to_ignore,
|
|
844
|
+
) -> bool:
|
|
845
|
+
try:
|
|
846
|
+
tcsetattr(self.input_fd, termios.TCSADRAIN, state)
|
|
847
|
+
except termios.error as te:
|
|
848
|
+
if te.args[0] not in ignore:
|
|
849
|
+
raise
|
|
850
|
+
return False
|
|
851
|
+
else:
|
|
852
|
+
return True
|