@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,687 @@
|
|
|
1
|
+
# Copyright 2000-2004 Michael Hudson-Doyle <micahel@gmail.com>
|
|
2
|
+
#
|
|
3
|
+
# All Rights Reserved
|
|
4
|
+
#
|
|
5
|
+
#
|
|
6
|
+
# Permission to use, copy, modify, and distribute this software and
|
|
7
|
+
# its documentation for any purpose is hereby granted without fee,
|
|
8
|
+
# provided that the above copyright notice appear in all copies and
|
|
9
|
+
# that both that copyright notice and this permission notice appear in
|
|
10
|
+
# supporting documentation.
|
|
11
|
+
#
|
|
12
|
+
# THE AUTHOR MICHAEL HUDSON DISCLAIMS ALL WARRANTIES WITH REGARD TO
|
|
13
|
+
# THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
14
|
+
# AND FITNESS, IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL,
|
|
15
|
+
# INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
|
|
16
|
+
# RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
|
|
17
|
+
# CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
|
|
18
|
+
# CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
19
|
+
|
|
20
|
+
from __future__ import annotations
|
|
21
|
+
|
|
22
|
+
import io
|
|
23
|
+
import os
|
|
24
|
+
import sys
|
|
25
|
+
import time
|
|
26
|
+
import msvcrt
|
|
27
|
+
|
|
28
|
+
from collections import deque
|
|
29
|
+
import ctypes
|
|
30
|
+
from ctypes.wintypes import (
|
|
31
|
+
_COORD,
|
|
32
|
+
WORD,
|
|
33
|
+
SMALL_RECT,
|
|
34
|
+
BOOL,
|
|
35
|
+
HANDLE,
|
|
36
|
+
CHAR,
|
|
37
|
+
DWORD,
|
|
38
|
+
WCHAR,
|
|
39
|
+
SHORT,
|
|
40
|
+
)
|
|
41
|
+
from ctypes import Structure, POINTER, Union
|
|
42
|
+
from .console import Event, Console
|
|
43
|
+
from .trace import trace
|
|
44
|
+
from .utils import wlen
|
|
45
|
+
from .windows_eventqueue import EventQueue
|
|
46
|
+
|
|
47
|
+
try:
|
|
48
|
+
from ctypes import GetLastError, WinDLL, windll, WinError # type: ignore[attr-defined]
|
|
49
|
+
except:
|
|
50
|
+
# Keep MyPy happy off Windows
|
|
51
|
+
from ctypes import CDLL as WinDLL, cdll as windll
|
|
52
|
+
|
|
53
|
+
def GetLastError() -> int:
|
|
54
|
+
return 42
|
|
55
|
+
|
|
56
|
+
class WinError(OSError): # type: ignore[no-redef]
|
|
57
|
+
def __init__(self, err: int | None, descr: str | None = None) -> None:
|
|
58
|
+
self.err = err
|
|
59
|
+
self.descr = descr
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
TYPE_CHECKING = False
|
|
63
|
+
|
|
64
|
+
if TYPE_CHECKING:
|
|
65
|
+
from typing import IO
|
|
66
|
+
|
|
67
|
+
# Virtual-Key Codes: https://learn.microsoft.com/en-us/windows/win32/inputdev/virtual-key-codes
|
|
68
|
+
VK_MAP: dict[int, str] = {
|
|
69
|
+
0x23: "end", # VK_END
|
|
70
|
+
0x24: "home", # VK_HOME
|
|
71
|
+
0x25: "left", # VK_LEFT
|
|
72
|
+
0x26: "up", # VK_UP
|
|
73
|
+
0x27: "right", # VK_RIGHT
|
|
74
|
+
0x28: "down", # VK_DOWN
|
|
75
|
+
0x2E: "delete", # VK_DELETE
|
|
76
|
+
0x70: "f1", # VK_F1
|
|
77
|
+
0x71: "f2", # VK_F2
|
|
78
|
+
0x72: "f3", # VK_F3
|
|
79
|
+
0x73: "f4", # VK_F4
|
|
80
|
+
0x74: "f5", # VK_F5
|
|
81
|
+
0x75: "f6", # VK_F6
|
|
82
|
+
0x76: "f7", # VK_F7
|
|
83
|
+
0x77: "f8", # VK_F8
|
|
84
|
+
0x78: "f9", # VK_F9
|
|
85
|
+
0x79: "f10", # VK_F10
|
|
86
|
+
0x7A: "f11", # VK_F11
|
|
87
|
+
0x7B: "f12", # VK_F12
|
|
88
|
+
0x7C: "f13", # VK_F13
|
|
89
|
+
0x7D: "f14", # VK_F14
|
|
90
|
+
0x7E: "f15", # VK_F15
|
|
91
|
+
0x7F: "f16", # VK_F16
|
|
92
|
+
0x80: "f17", # VK_F17
|
|
93
|
+
0x81: "f18", # VK_F18
|
|
94
|
+
0x82: "f19", # VK_F19
|
|
95
|
+
0x83: "f20", # VK_F20
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
# Virtual terminal output sequences
|
|
99
|
+
# Reference: https://learn.microsoft.com/en-us/windows/console/console-virtual-terminal-sequences#output-sequences
|
|
100
|
+
# Check `windows_eventqueue.py` for input sequences
|
|
101
|
+
ERASE_IN_LINE = "\x1b[K"
|
|
102
|
+
MOVE_LEFT = "\x1b[{}D"
|
|
103
|
+
MOVE_RIGHT = "\x1b[{}C"
|
|
104
|
+
MOVE_UP = "\x1b[{}A"
|
|
105
|
+
MOVE_DOWN = "\x1b[{}B"
|
|
106
|
+
CLEAR = "\x1b[H\x1b[J"
|
|
107
|
+
|
|
108
|
+
# State of control keys: https://learn.microsoft.com/en-us/windows/console/key-event-record-str
|
|
109
|
+
ALT_ACTIVE = 0x01 | 0x02
|
|
110
|
+
CTRL_ACTIVE = 0x04 | 0x08
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
class _error(Exception):
|
|
114
|
+
pass
|
|
115
|
+
|
|
116
|
+
def _supports_vt():
|
|
117
|
+
try:
|
|
118
|
+
import nt
|
|
119
|
+
return nt._supports_virtual_terminal()
|
|
120
|
+
except (ImportError, AttributeError):
|
|
121
|
+
return False
|
|
122
|
+
|
|
123
|
+
class WindowsConsole(Console):
|
|
124
|
+
def __init__(
|
|
125
|
+
self,
|
|
126
|
+
f_in: IO[bytes] | int = 0,
|
|
127
|
+
f_out: IO[bytes] | int = 1,
|
|
128
|
+
term: str = "",
|
|
129
|
+
encoding: str = "",
|
|
130
|
+
):
|
|
131
|
+
super().__init__(f_in, f_out, term, encoding)
|
|
132
|
+
|
|
133
|
+
self.__vt_support = _supports_vt()
|
|
134
|
+
|
|
135
|
+
if self.__vt_support:
|
|
136
|
+
trace('console supports virtual terminal')
|
|
137
|
+
|
|
138
|
+
# Save original console modes so we can recover on cleanup.
|
|
139
|
+
original_input_mode = DWORD()
|
|
140
|
+
GetConsoleMode(InHandle, original_input_mode)
|
|
141
|
+
trace(f'saved original input mode 0x{original_input_mode.value:x}')
|
|
142
|
+
self.__original_input_mode = original_input_mode.value
|
|
143
|
+
|
|
144
|
+
SetConsoleMode(
|
|
145
|
+
OutHandle,
|
|
146
|
+
ENABLE_WRAP_AT_EOL_OUTPUT
|
|
147
|
+
| ENABLE_PROCESSED_OUTPUT
|
|
148
|
+
| ENABLE_VIRTUAL_TERMINAL_PROCESSING,
|
|
149
|
+
)
|
|
150
|
+
|
|
151
|
+
self.screen: list[str] = []
|
|
152
|
+
self.width = 80
|
|
153
|
+
self.height = 25
|
|
154
|
+
self.__offset = 0
|
|
155
|
+
self.event_queue = EventQueue(encoding)
|
|
156
|
+
try:
|
|
157
|
+
self.out = io._WindowsConsoleIO(self.output_fd, "w") # type: ignore[attr-defined]
|
|
158
|
+
except ValueError:
|
|
159
|
+
# Console I/O is redirected, fallback...
|
|
160
|
+
self.out = None
|
|
161
|
+
|
|
162
|
+
def refresh(self, screen: list[str], c_xy: tuple[int, int]) -> None:
|
|
163
|
+
"""
|
|
164
|
+
Refresh the console screen.
|
|
165
|
+
|
|
166
|
+
Parameters:
|
|
167
|
+
- screen (list): List of strings representing the screen contents.
|
|
168
|
+
- c_xy (tuple): Cursor position (x, y) on the screen.
|
|
169
|
+
"""
|
|
170
|
+
cx, cy = c_xy
|
|
171
|
+
|
|
172
|
+
while len(self.screen) < min(len(screen), self.height):
|
|
173
|
+
self._hide_cursor()
|
|
174
|
+
if self.screen:
|
|
175
|
+
self._move_relative(0, len(self.screen) - 1)
|
|
176
|
+
self.__write("\n")
|
|
177
|
+
self.posxy = 0, len(self.screen)
|
|
178
|
+
self.screen.append("")
|
|
179
|
+
|
|
180
|
+
px, py = self.posxy
|
|
181
|
+
old_offset = offset = self.__offset
|
|
182
|
+
height = self.height
|
|
183
|
+
|
|
184
|
+
# we make sure the cursor is on the screen, and that we're
|
|
185
|
+
# using all of the screen if we can
|
|
186
|
+
if cy < offset:
|
|
187
|
+
offset = cy
|
|
188
|
+
elif cy >= offset + height:
|
|
189
|
+
offset = cy - height + 1
|
|
190
|
+
scroll_lines = offset - old_offset
|
|
191
|
+
|
|
192
|
+
# Scrolling the buffer as the current input is greater than the visible
|
|
193
|
+
# portion of the window. We need to scroll the visible portion and the
|
|
194
|
+
# entire history
|
|
195
|
+
self._scroll(scroll_lines, self._getscrollbacksize())
|
|
196
|
+
self.posxy = self.posxy[0], self.posxy[1] + scroll_lines
|
|
197
|
+
self.__offset += scroll_lines
|
|
198
|
+
|
|
199
|
+
for i in range(scroll_lines):
|
|
200
|
+
self.screen.append("")
|
|
201
|
+
elif offset > 0 and len(screen) < offset + height:
|
|
202
|
+
offset = max(len(screen) - height, 0)
|
|
203
|
+
screen.append("")
|
|
204
|
+
|
|
205
|
+
oldscr = self.screen[old_offset : old_offset + height]
|
|
206
|
+
newscr = screen[offset : offset + height]
|
|
207
|
+
|
|
208
|
+
self.__offset = offset
|
|
209
|
+
|
|
210
|
+
self._hide_cursor()
|
|
211
|
+
for (
|
|
212
|
+
y,
|
|
213
|
+
oldline,
|
|
214
|
+
newline,
|
|
215
|
+
) in zip(range(offset, offset + height), oldscr, newscr):
|
|
216
|
+
if oldline != newline:
|
|
217
|
+
self.__write_changed_line(y, oldline, newline, px)
|
|
218
|
+
|
|
219
|
+
y = len(newscr)
|
|
220
|
+
while y < len(oldscr):
|
|
221
|
+
self._move_relative(0, y)
|
|
222
|
+
self.posxy = 0, y
|
|
223
|
+
self._erase_to_end()
|
|
224
|
+
y += 1
|
|
225
|
+
|
|
226
|
+
self._show_cursor()
|
|
227
|
+
|
|
228
|
+
self.screen = screen
|
|
229
|
+
self.move_cursor(cx, cy)
|
|
230
|
+
|
|
231
|
+
@property
|
|
232
|
+
def input_hook(self):
|
|
233
|
+
try:
|
|
234
|
+
import nt
|
|
235
|
+
except ImportError:
|
|
236
|
+
return None
|
|
237
|
+
if nt._is_inputhook_installed():
|
|
238
|
+
return nt._inputhook
|
|
239
|
+
|
|
240
|
+
def __write_changed_line(
|
|
241
|
+
self, y: int, oldline: str, newline: str, px_coord: int
|
|
242
|
+
) -> None:
|
|
243
|
+
# this is frustrating; there's no reason to test (say)
|
|
244
|
+
# self.dch1 inside the loop -- but alternative ways of
|
|
245
|
+
# structuring this function are equally painful (I'm trying to
|
|
246
|
+
# avoid writing code generators these days...)
|
|
247
|
+
minlen = min(wlen(oldline), wlen(newline))
|
|
248
|
+
x_pos = 0
|
|
249
|
+
x_coord = 0
|
|
250
|
+
|
|
251
|
+
px_pos = 0
|
|
252
|
+
j = 0
|
|
253
|
+
for c in oldline:
|
|
254
|
+
if j >= px_coord:
|
|
255
|
+
break
|
|
256
|
+
j += wlen(c)
|
|
257
|
+
px_pos += 1
|
|
258
|
+
|
|
259
|
+
# reuse the oldline as much as possible, but stop as soon as we
|
|
260
|
+
# encounter an ESCAPE, because it might be the start of an escape
|
|
261
|
+
# sequene
|
|
262
|
+
while (
|
|
263
|
+
x_coord < minlen
|
|
264
|
+
and oldline[x_pos] == newline[x_pos]
|
|
265
|
+
and newline[x_pos] != "\x1b"
|
|
266
|
+
):
|
|
267
|
+
x_coord += wlen(newline[x_pos])
|
|
268
|
+
x_pos += 1
|
|
269
|
+
|
|
270
|
+
self._hide_cursor()
|
|
271
|
+
self._move_relative(x_coord, y)
|
|
272
|
+
if wlen(oldline) > wlen(newline):
|
|
273
|
+
self._erase_to_end()
|
|
274
|
+
|
|
275
|
+
self.__write(newline[x_pos:])
|
|
276
|
+
self.posxy = min(wlen(newline), self.width - 1), y
|
|
277
|
+
|
|
278
|
+
if "\x1b" in newline or y != self.posxy[1] or '\x1a' in newline:
|
|
279
|
+
# ANSI escape characters are present, so we can't assume
|
|
280
|
+
# anything about the position of the cursor. Moving the cursor
|
|
281
|
+
# to the left margin should work to get to a known position.
|
|
282
|
+
self.move_cursor(0, y)
|
|
283
|
+
|
|
284
|
+
def _scroll(
|
|
285
|
+
self, top: int, bottom: int, left: int | None = None, right: int | None = None
|
|
286
|
+
) -> None:
|
|
287
|
+
scroll_rect = SMALL_RECT()
|
|
288
|
+
scroll_rect.Top = SHORT(top)
|
|
289
|
+
scroll_rect.Bottom = SHORT(bottom)
|
|
290
|
+
scroll_rect.Left = SHORT(0 if left is None else left)
|
|
291
|
+
scroll_rect.Right = SHORT(
|
|
292
|
+
self.getheightwidth()[1] - 1 if right is None else right
|
|
293
|
+
)
|
|
294
|
+
destination_origin = _COORD()
|
|
295
|
+
fill_info = CHAR_INFO()
|
|
296
|
+
fill_info.UnicodeChar = " "
|
|
297
|
+
|
|
298
|
+
if not ScrollConsoleScreenBuffer(
|
|
299
|
+
OutHandle, scroll_rect, None, destination_origin, fill_info
|
|
300
|
+
):
|
|
301
|
+
raise WinError(GetLastError())
|
|
302
|
+
|
|
303
|
+
def _hide_cursor(self):
|
|
304
|
+
self.__write("\x1b[?25l")
|
|
305
|
+
|
|
306
|
+
def _show_cursor(self):
|
|
307
|
+
self.__write("\x1b[?25h")
|
|
308
|
+
|
|
309
|
+
def _enable_blinking(self):
|
|
310
|
+
self.__write("\x1b[?12h")
|
|
311
|
+
|
|
312
|
+
def _disable_blinking(self):
|
|
313
|
+
self.__write("\x1b[?12l")
|
|
314
|
+
|
|
315
|
+
def _enable_bracketed_paste(self) -> None:
|
|
316
|
+
self.__write("\x1b[?2004h")
|
|
317
|
+
|
|
318
|
+
def _disable_bracketed_paste(self) -> None:
|
|
319
|
+
self.__write("\x1b[?2004l")
|
|
320
|
+
|
|
321
|
+
def __write(self, text: str) -> None:
|
|
322
|
+
if "\x1a" in text:
|
|
323
|
+
text = ''.join(["^Z" if x == '\x1a' else x for x in text])
|
|
324
|
+
|
|
325
|
+
if self.out is not None:
|
|
326
|
+
self.out.write(text.encode(self.encoding, "replace"))
|
|
327
|
+
self.out.flush()
|
|
328
|
+
else:
|
|
329
|
+
os.write(self.output_fd, text.encode(self.encoding, "replace"))
|
|
330
|
+
|
|
331
|
+
@property
|
|
332
|
+
def screen_xy(self) -> tuple[int, int]:
|
|
333
|
+
info = CONSOLE_SCREEN_BUFFER_INFO()
|
|
334
|
+
if not GetConsoleScreenBufferInfo(OutHandle, info):
|
|
335
|
+
raise WinError(GetLastError())
|
|
336
|
+
return info.dwCursorPosition.X, info.dwCursorPosition.Y
|
|
337
|
+
|
|
338
|
+
def _erase_to_end(self) -> None:
|
|
339
|
+
self.__write(ERASE_IN_LINE)
|
|
340
|
+
|
|
341
|
+
def prepare(self) -> None:
|
|
342
|
+
trace("prepare")
|
|
343
|
+
self.screen = []
|
|
344
|
+
self.height, self.width = self.getheightwidth()
|
|
345
|
+
|
|
346
|
+
self.posxy = 0, 0
|
|
347
|
+
self.__gone_tall = 0
|
|
348
|
+
self.__offset = 0
|
|
349
|
+
|
|
350
|
+
if self.__vt_support:
|
|
351
|
+
SetConsoleMode(InHandle, self.__original_input_mode | ENABLE_VIRTUAL_TERMINAL_INPUT)
|
|
352
|
+
self._enable_bracketed_paste()
|
|
353
|
+
|
|
354
|
+
def restore(self) -> None:
|
|
355
|
+
if self.__vt_support:
|
|
356
|
+
# Recover to original mode before running REPL
|
|
357
|
+
self._disable_bracketed_paste()
|
|
358
|
+
SetConsoleMode(InHandle, self.__original_input_mode)
|
|
359
|
+
|
|
360
|
+
def _move_relative(self, x: int, y: int) -> None:
|
|
361
|
+
"""Moves relative to the current posxy"""
|
|
362
|
+
dx = x - self.posxy[0]
|
|
363
|
+
dy = y - self.posxy[1]
|
|
364
|
+
if dx < 0:
|
|
365
|
+
self.__write(MOVE_LEFT.format(-dx))
|
|
366
|
+
elif dx > 0:
|
|
367
|
+
self.__write(MOVE_RIGHT.format(dx))
|
|
368
|
+
|
|
369
|
+
if dy < 0:
|
|
370
|
+
self.__write(MOVE_UP.format(-dy))
|
|
371
|
+
elif dy > 0:
|
|
372
|
+
self.__write(MOVE_DOWN.format(dy))
|
|
373
|
+
|
|
374
|
+
def move_cursor(self, x: int, y: int) -> None:
|
|
375
|
+
if x < 0 or y < 0:
|
|
376
|
+
raise ValueError(f"Bad cursor position {x}, {y}")
|
|
377
|
+
|
|
378
|
+
if y < self.__offset or y >= self.__offset + self.height:
|
|
379
|
+
self.event_queue.insert(Event("scroll", ""))
|
|
380
|
+
else:
|
|
381
|
+
self._move_relative(x, y)
|
|
382
|
+
self.posxy = x, y
|
|
383
|
+
|
|
384
|
+
def set_cursor_vis(self, visible: bool) -> None:
|
|
385
|
+
if visible:
|
|
386
|
+
self._show_cursor()
|
|
387
|
+
else:
|
|
388
|
+
self._hide_cursor()
|
|
389
|
+
|
|
390
|
+
def getheightwidth(self) -> tuple[int, int]:
|
|
391
|
+
"""Return (height, width) where height and width are the height
|
|
392
|
+
and width of the terminal window in characters."""
|
|
393
|
+
info = CONSOLE_SCREEN_BUFFER_INFO()
|
|
394
|
+
if not GetConsoleScreenBufferInfo(OutHandle, info):
|
|
395
|
+
raise WinError(GetLastError())
|
|
396
|
+
return (
|
|
397
|
+
info.srWindow.Bottom - info.srWindow.Top + 1,
|
|
398
|
+
info.srWindow.Right - info.srWindow.Left + 1,
|
|
399
|
+
)
|
|
400
|
+
|
|
401
|
+
def _getscrollbacksize(self) -> int:
|
|
402
|
+
info = CONSOLE_SCREEN_BUFFER_INFO()
|
|
403
|
+
if not GetConsoleScreenBufferInfo(OutHandle, info):
|
|
404
|
+
raise WinError(GetLastError())
|
|
405
|
+
|
|
406
|
+
return info.srWindow.Bottom # type: ignore[no-any-return]
|
|
407
|
+
|
|
408
|
+
def _read_input(self, block: bool = True) -> INPUT_RECORD | None:
|
|
409
|
+
if not block:
|
|
410
|
+
events = DWORD()
|
|
411
|
+
if not GetNumberOfConsoleInputEvents(InHandle, events):
|
|
412
|
+
raise WinError(GetLastError())
|
|
413
|
+
if not events.value:
|
|
414
|
+
return None
|
|
415
|
+
|
|
416
|
+
rec = INPUT_RECORD()
|
|
417
|
+
read = DWORD()
|
|
418
|
+
if not ReadConsoleInput(InHandle, rec, 1, read):
|
|
419
|
+
raise WinError(GetLastError())
|
|
420
|
+
|
|
421
|
+
return rec
|
|
422
|
+
|
|
423
|
+
def get_event(self, block: bool = True) -> Event | None:
|
|
424
|
+
"""Return an Event instance. Returns None if |block| is false
|
|
425
|
+
and there is no event pending, otherwise waits for the
|
|
426
|
+
completion of an event."""
|
|
427
|
+
|
|
428
|
+
while self.event_queue.empty():
|
|
429
|
+
rec = self._read_input(block)
|
|
430
|
+
if rec is None:
|
|
431
|
+
return None
|
|
432
|
+
|
|
433
|
+
if rec.EventType == WINDOW_BUFFER_SIZE_EVENT:
|
|
434
|
+
return Event("resize", "")
|
|
435
|
+
|
|
436
|
+
if rec.EventType != KEY_EVENT or not rec.Event.KeyEvent.bKeyDown:
|
|
437
|
+
# Only process keys and keydown events
|
|
438
|
+
if block:
|
|
439
|
+
continue
|
|
440
|
+
return None
|
|
441
|
+
|
|
442
|
+
key_event = rec.Event.KeyEvent
|
|
443
|
+
raw_key = key = key_event.uChar.UnicodeChar
|
|
444
|
+
|
|
445
|
+
if key == "\r":
|
|
446
|
+
# Make enter unix-like
|
|
447
|
+
return Event(evt="key", data="\n")
|
|
448
|
+
elif key_event.wVirtualKeyCode == 8:
|
|
449
|
+
# Turn backspace directly into the command
|
|
450
|
+
key = "backspace"
|
|
451
|
+
elif key == "\x00":
|
|
452
|
+
# Handle special keys like arrow keys and translate them into the appropriate command
|
|
453
|
+
key = VK_MAP.get(key_event.wVirtualKeyCode)
|
|
454
|
+
if key:
|
|
455
|
+
if key_event.dwControlKeyState & CTRL_ACTIVE:
|
|
456
|
+
key = f"ctrl {key}"
|
|
457
|
+
elif key_event.dwControlKeyState & ALT_ACTIVE:
|
|
458
|
+
# queue the key, return the meta command
|
|
459
|
+
self.event_queue.insert(Event(evt="key", data=key))
|
|
460
|
+
return Event(evt="key", data="\033") # keymap.py uses this for meta
|
|
461
|
+
return Event(evt="key", data=key)
|
|
462
|
+
if block:
|
|
463
|
+
continue
|
|
464
|
+
|
|
465
|
+
return None
|
|
466
|
+
elif self.__vt_support:
|
|
467
|
+
# If virtual terminal is enabled, scanning VT sequences
|
|
468
|
+
for char in raw_key.encode(self.event_queue.encoding, "replace"):
|
|
469
|
+
self.event_queue.push(char)
|
|
470
|
+
continue
|
|
471
|
+
|
|
472
|
+
if key_event.dwControlKeyState & ALT_ACTIVE:
|
|
473
|
+
# Do not swallow characters that have been entered via AltGr:
|
|
474
|
+
# Windows internally converts AltGr to CTRL+ALT, see
|
|
475
|
+
# https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-vkkeyscanw
|
|
476
|
+
if not key_event.dwControlKeyState & CTRL_ACTIVE:
|
|
477
|
+
# queue the key, return the meta command
|
|
478
|
+
self.event_queue.insert(Event(evt="key", data=key))
|
|
479
|
+
return Event(evt="key", data="\033") # keymap.py uses this for meta
|
|
480
|
+
|
|
481
|
+
return Event(evt="key", data=key)
|
|
482
|
+
return self.event_queue.get()
|
|
483
|
+
|
|
484
|
+
def push_char(self, char: int | bytes) -> None:
|
|
485
|
+
"""
|
|
486
|
+
Push a character to the console event queue.
|
|
487
|
+
"""
|
|
488
|
+
raise NotImplementedError("push_char not supported on Windows")
|
|
489
|
+
|
|
490
|
+
def beep(self) -> None:
|
|
491
|
+
self.__write("\x07")
|
|
492
|
+
|
|
493
|
+
def clear(self) -> None:
|
|
494
|
+
"""Wipe the screen"""
|
|
495
|
+
self.__write(CLEAR)
|
|
496
|
+
self.posxy = 0, 0
|
|
497
|
+
self.screen = []
|
|
498
|
+
|
|
499
|
+
def finish(self) -> None:
|
|
500
|
+
"""Move the cursor to the end of the display and otherwise get
|
|
501
|
+
ready for end. XXX could be merged with restore? Hmm."""
|
|
502
|
+
y = len(self.screen) - 1
|
|
503
|
+
while y >= 0 and not self.screen[y]:
|
|
504
|
+
y -= 1
|
|
505
|
+
self._move_relative(0, min(y, self.height + self.__offset - 1))
|
|
506
|
+
self.__write("\r\n")
|
|
507
|
+
|
|
508
|
+
def flushoutput(self) -> None:
|
|
509
|
+
"""Flush all output to the screen (assuming there's some
|
|
510
|
+
buffering going on somewhere).
|
|
511
|
+
|
|
512
|
+
All output on Windows is unbuffered so this is a nop"""
|
|
513
|
+
pass
|
|
514
|
+
|
|
515
|
+
def forgetinput(self) -> None:
|
|
516
|
+
"""Forget all pending, but not yet processed input."""
|
|
517
|
+
if not FlushConsoleInputBuffer(InHandle):
|
|
518
|
+
raise WinError(GetLastError())
|
|
519
|
+
|
|
520
|
+
def getpending(self) -> Event:
|
|
521
|
+
"""Return the characters that have been typed but not yet
|
|
522
|
+
processed."""
|
|
523
|
+
return Event("key", "", b"")
|
|
524
|
+
|
|
525
|
+
def wait_for_event(self, timeout: float | None) -> bool:
|
|
526
|
+
"""Wait for an event."""
|
|
527
|
+
# Poor man's Windows select loop
|
|
528
|
+
start_time = time.time()
|
|
529
|
+
while True:
|
|
530
|
+
if msvcrt.kbhit(): # type: ignore[attr-defined]
|
|
531
|
+
return True
|
|
532
|
+
if timeout and time.time() - start_time > timeout / 1000:
|
|
533
|
+
return False
|
|
534
|
+
time.sleep(0.01)
|
|
535
|
+
|
|
536
|
+
def wait(self, timeout: float | None) -> bool:
|
|
537
|
+
"""
|
|
538
|
+
Wait for events on the console.
|
|
539
|
+
"""
|
|
540
|
+
return (
|
|
541
|
+
not self.event_queue.empty()
|
|
542
|
+
or self.wait_for_event(timeout)
|
|
543
|
+
)
|
|
544
|
+
|
|
545
|
+
def repaint(self) -> None:
|
|
546
|
+
raise NotImplementedError("No repaint support")
|
|
547
|
+
|
|
548
|
+
|
|
549
|
+
# Windows interop
|
|
550
|
+
class CONSOLE_SCREEN_BUFFER_INFO(Structure):
|
|
551
|
+
_fields_ = [
|
|
552
|
+
("dwSize", _COORD),
|
|
553
|
+
("dwCursorPosition", _COORD),
|
|
554
|
+
("wAttributes", WORD),
|
|
555
|
+
("srWindow", SMALL_RECT),
|
|
556
|
+
("dwMaximumWindowSize", _COORD),
|
|
557
|
+
]
|
|
558
|
+
|
|
559
|
+
|
|
560
|
+
class CONSOLE_CURSOR_INFO(Structure):
|
|
561
|
+
_fields_ = [
|
|
562
|
+
("dwSize", DWORD),
|
|
563
|
+
("bVisible", BOOL),
|
|
564
|
+
]
|
|
565
|
+
|
|
566
|
+
|
|
567
|
+
class CHAR_INFO(Structure):
|
|
568
|
+
_fields_ = [
|
|
569
|
+
("UnicodeChar", WCHAR),
|
|
570
|
+
("Attributes", WORD),
|
|
571
|
+
]
|
|
572
|
+
|
|
573
|
+
|
|
574
|
+
class Char(Union):
|
|
575
|
+
_fields_ = [
|
|
576
|
+
("UnicodeChar", WCHAR),
|
|
577
|
+
("Char", CHAR),
|
|
578
|
+
]
|
|
579
|
+
|
|
580
|
+
|
|
581
|
+
class KeyEvent(ctypes.Structure):
|
|
582
|
+
_fields_ = [
|
|
583
|
+
("bKeyDown", BOOL),
|
|
584
|
+
("wRepeatCount", WORD),
|
|
585
|
+
("wVirtualKeyCode", WORD),
|
|
586
|
+
("wVirtualScanCode", WORD),
|
|
587
|
+
("uChar", Char),
|
|
588
|
+
("dwControlKeyState", DWORD),
|
|
589
|
+
]
|
|
590
|
+
|
|
591
|
+
|
|
592
|
+
class WindowsBufferSizeEvent(ctypes.Structure):
|
|
593
|
+
_fields_ = [("dwSize", _COORD)]
|
|
594
|
+
|
|
595
|
+
|
|
596
|
+
class ConsoleEvent(ctypes.Union):
|
|
597
|
+
_fields_ = [
|
|
598
|
+
("KeyEvent", KeyEvent),
|
|
599
|
+
("WindowsBufferSizeEvent", WindowsBufferSizeEvent),
|
|
600
|
+
]
|
|
601
|
+
|
|
602
|
+
|
|
603
|
+
class INPUT_RECORD(Structure):
|
|
604
|
+
_fields_ = [("EventType", WORD), ("Event", ConsoleEvent)]
|
|
605
|
+
|
|
606
|
+
|
|
607
|
+
KEY_EVENT = 0x01
|
|
608
|
+
FOCUS_EVENT = 0x10
|
|
609
|
+
MENU_EVENT = 0x08
|
|
610
|
+
MOUSE_EVENT = 0x02
|
|
611
|
+
WINDOW_BUFFER_SIZE_EVENT = 0x04
|
|
612
|
+
|
|
613
|
+
ENABLE_PROCESSED_INPUT = 0x0001
|
|
614
|
+
ENABLE_LINE_INPUT = 0x0002
|
|
615
|
+
ENABLE_ECHO_INPUT = 0x0004
|
|
616
|
+
ENABLE_MOUSE_INPUT = 0x0010
|
|
617
|
+
ENABLE_INSERT_MODE = 0x0020
|
|
618
|
+
ENABLE_VIRTUAL_TERMINAL_INPUT = 0x0200
|
|
619
|
+
|
|
620
|
+
ENABLE_PROCESSED_OUTPUT = 0x01
|
|
621
|
+
ENABLE_WRAP_AT_EOL_OUTPUT = 0x02
|
|
622
|
+
ENABLE_VIRTUAL_TERMINAL_PROCESSING = 0x04
|
|
623
|
+
|
|
624
|
+
STD_INPUT_HANDLE = -10
|
|
625
|
+
STD_OUTPUT_HANDLE = -11
|
|
626
|
+
|
|
627
|
+
if sys.platform == "win32":
|
|
628
|
+
_KERNEL32 = WinDLL("kernel32", use_last_error=True)
|
|
629
|
+
|
|
630
|
+
GetStdHandle = windll.kernel32.GetStdHandle
|
|
631
|
+
GetStdHandle.argtypes = [DWORD]
|
|
632
|
+
GetStdHandle.restype = HANDLE
|
|
633
|
+
|
|
634
|
+
GetConsoleScreenBufferInfo = _KERNEL32.GetConsoleScreenBufferInfo
|
|
635
|
+
GetConsoleScreenBufferInfo.argtypes = [
|
|
636
|
+
HANDLE,
|
|
637
|
+
ctypes.POINTER(CONSOLE_SCREEN_BUFFER_INFO),
|
|
638
|
+
]
|
|
639
|
+
GetConsoleScreenBufferInfo.restype = BOOL
|
|
640
|
+
|
|
641
|
+
ScrollConsoleScreenBuffer = _KERNEL32.ScrollConsoleScreenBufferW
|
|
642
|
+
ScrollConsoleScreenBuffer.argtypes = [
|
|
643
|
+
HANDLE,
|
|
644
|
+
POINTER(SMALL_RECT),
|
|
645
|
+
POINTER(SMALL_RECT),
|
|
646
|
+
_COORD,
|
|
647
|
+
POINTER(CHAR_INFO),
|
|
648
|
+
]
|
|
649
|
+
ScrollConsoleScreenBuffer.restype = BOOL
|
|
650
|
+
|
|
651
|
+
GetConsoleMode = _KERNEL32.GetConsoleMode
|
|
652
|
+
GetConsoleMode.argtypes = [HANDLE, POINTER(DWORD)]
|
|
653
|
+
GetConsoleMode.restype = BOOL
|
|
654
|
+
|
|
655
|
+
SetConsoleMode = _KERNEL32.SetConsoleMode
|
|
656
|
+
SetConsoleMode.argtypes = [HANDLE, DWORD]
|
|
657
|
+
SetConsoleMode.restype = BOOL
|
|
658
|
+
|
|
659
|
+
ReadConsoleInput = _KERNEL32.ReadConsoleInputW
|
|
660
|
+
ReadConsoleInput.argtypes = [HANDLE, POINTER(INPUT_RECORD), DWORD, POINTER(DWORD)]
|
|
661
|
+
ReadConsoleInput.restype = BOOL
|
|
662
|
+
|
|
663
|
+
GetNumberOfConsoleInputEvents = _KERNEL32.GetNumberOfConsoleInputEvents
|
|
664
|
+
GetNumberOfConsoleInputEvents.argtypes = [HANDLE, POINTER(DWORD)]
|
|
665
|
+
GetNumberOfConsoleInputEvents.restype = BOOL
|
|
666
|
+
|
|
667
|
+
FlushConsoleInputBuffer = _KERNEL32.FlushConsoleInputBuffer
|
|
668
|
+
FlushConsoleInputBuffer.argtypes = [HANDLE]
|
|
669
|
+
FlushConsoleInputBuffer.restype = BOOL
|
|
670
|
+
|
|
671
|
+
OutHandle = GetStdHandle(STD_OUTPUT_HANDLE)
|
|
672
|
+
InHandle = GetStdHandle(STD_INPUT_HANDLE)
|
|
673
|
+
else:
|
|
674
|
+
|
|
675
|
+
def _win_only(*args, **kwargs):
|
|
676
|
+
raise NotImplementedError("Windows only")
|
|
677
|
+
|
|
678
|
+
GetStdHandle = _win_only
|
|
679
|
+
GetConsoleScreenBufferInfo = _win_only
|
|
680
|
+
ScrollConsoleScreenBuffer = _win_only
|
|
681
|
+
GetConsoleMode = _win_only
|
|
682
|
+
SetConsoleMode = _win_only
|
|
683
|
+
ReadConsoleInput = _win_only
|
|
684
|
+
GetNumberOfConsoleInputEvents = _win_only
|
|
685
|
+
FlushConsoleInputBuffer = _win_only
|
|
686
|
+
OutHandle = 0
|
|
687
|
+
InHandle = 0
|