pytron-kit 0.3.12__py3-none-macosx_11_0_universal2.whl
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.
- pytron/__init__.py +112 -0
- pytron/application.py +562 -0
- pytron/apputils/__init__.py +0 -0
- pytron/apputils/chrome_ipc.py +203 -0
- pytron/apputils/codegen.py +261 -0
- pytron/apputils/config.py +303 -0
- pytron/apputils/deadmansswitch.py +47 -0
- pytron/apputils/extras.py +76 -0
- pytron/apputils/native.py +148 -0
- pytron/apputils/shell.py +73 -0
- pytron/apputils/windows.py +286 -0
- pytron/cli.py +384 -0
- pytron/commands/__init__.py +0 -0
- pytron/commands/android.py +28 -0
- pytron/commands/build.py +26 -0
- pytron/commands/doctor.py +221 -0
- pytron/commands/engine.py +23 -0
- pytron/commands/frontend.py +60 -0
- pytron/commands/harvest.py +112 -0
- pytron/commands/helpers.py +239 -0
- pytron/commands/info.py +50 -0
- pytron/commands/init.py +521 -0
- pytron/commands/install.py +294 -0
- pytron/commands/login.py +130 -0
- pytron/commands/package.py +228 -0
- pytron/commands/plugin.py +442 -0
- pytron/commands/run.py +312 -0
- pytron/commands/scan.py +210 -0
- pytron/commands/show.py +23 -0
- pytron/commands/uninstall.py +150 -0
- pytron/commands/utils.py +42 -0
- pytron/commands/workflow.py +95 -0
- pytron/console.py +133 -0
- pytron/core.py +18 -0
- pytron/dependencies/WebView2Loader.dll +0 -0
- pytron/dependencies/__init__.py +1 -0
- pytron/dependencies/pytron_native.so +0 -0
- pytron/engines/chrome/adapter.py +445 -0
- pytron/engines/chrome/engine.py +576 -0
- pytron/engines/chrome/forge.py +147 -0
- pytron/engines/chrome/shell/package.json +8 -0
- pytron/engines/chrome/shell/preload.js +12 -0
- pytron/engines/chrome/shell/shell.js +534 -0
- pytron/exceptions.py +36 -0
- pytron/inspector.py +201 -0
- pytron/inspector_ui.py +512 -0
- pytron/installer/Installation.nsi +236 -0
- pytron/installer/header.bmp +0 -0
- pytron/installer/pytron.ico +0 -0
- pytron/installer/sidebar.bmp +0 -0
- pytron/llms.md +98 -0
- pytron/manifests/README.md +29 -0
- pytron/manifests/windows-utf8.manifest +44 -0
- pytron/menu.py +128 -0
- pytron/nsis-setup.exe +0 -0
- pytron/pack/__init__.py +0 -0
- pytron/pack/assets.py +131 -0
- pytron/pack/compilers.py +289 -0
- pytron/pack/crystal.py +297 -0
- pytron/pack/graph.py +377 -0
- pytron/pack/inference.py +157 -0
- pytron/pack/installers.py +402 -0
- pytron/pack/introspect.py +357 -0
- pytron/pack/metadata.py +213 -0
- pytron/pack/modules.py +618 -0
- pytron/pack/nuitka.py +108 -0
- pytron/pack/pipeline.py +107 -0
- pytron/pack/pyinstaller.py +176 -0
- pytron/pack/rust_engine.py +273 -0
- pytron/pack/secure.py +309 -0
- pytron/pack/secure_loader/bin/pytron_rust_bootloader +0 -0
- pytron/pack/secure_loader/icon.ico +0 -0
- pytron/pack/utils.py +110 -0
- pytron/pack/virtual_root.py +124 -0
- pytron/platforms/__init__.py +0 -0
- pytron/platforms/android/__init__.py +3 -0
- pytron/platforms/android/android.py +103 -0
- pytron/platforms/android/builder.py +736 -0
- pytron/platforms/android/ops/build.py +79 -0
- pytron/platforms/android/ops/init.py +63 -0
- pytron/platforms/android/ops/run.py +79 -0
- pytron/platforms/android/ops/sync.py +770 -0
- pytron/platforms/android/ops/utils.py +8 -0
- pytron/platforms/android/shell/README.md +30 -0
- pytron/platforms/android/shell/app/build.gradle +64 -0
- pytron/platforms/android/shell/app/src/main/AndroidManifest.xml +29 -0
- pytron/platforms/android/shell/app/src/main/assets/python/main.py +86 -0
- pytron/platforms/android/shell/app/src/main/assets/python/python314.zip +0 -0
- pytron/platforms/android/shell/app/src/main/cpp/CMakeLists.txt +25 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/Python.h +155 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/abstract.h +915 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/audit.h +30 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/bltinmodule.h +14 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/boolobject.h +54 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/bytearrayobject.h +44 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/bytesobject.h +66 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/ceval.h +145 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/codecs.h +176 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/compile.h +22 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/complexobject.h +30 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/abstract.h +104 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/audit.h +8 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/bytearrayobject.h +38 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/bytesobject.h +42 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/cellobject.h +50 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/ceval.h +43 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/classobject.h +71 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/code.h +340 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/compile.h +50 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/complexobject.h +33 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/context.h +107 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/critical_section.h +154 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/descrobject.h +62 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/dictobject.h +105 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/fileobject.h +16 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/fileutils.h +16 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/floatobject.h +27 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/frameobject.h +35 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/funcobject.h +185 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/genobject.h +56 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/import.h +30 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/initconfig.h +334 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/listobject.h +53 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/lock.h +74 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/longintrepr.h +184 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/longobject.h +89 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/memoryobject.h +50 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/methodobject.h +66 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/modsupport.h +26 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/monitoring.h +269 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/object.h +493 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/objimpl.h +104 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/odictobject.h +43 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/picklebufobject.h +31 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pthread_stubs.h +105 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pyatomic.h +614 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pyatomic_gcc.h +615 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pyatomic_msc.h +1197 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pyatomic_std.h +1112 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pyctype.h +39 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pydebug.h +38 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pyerrors.h +132 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pyfpe.h +15 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pyframe.h +45 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pyhash.h +54 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pylifecycle.h +89 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pymem.h +84 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pystate.h +275 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pystats.h +194 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pythonrun.h +96 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pythread.h +43 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pytime.h +27 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/setobject.h +71 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/traceback.h +13 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/tracemalloc.h +32 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/tupleobject.h +40 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/unicodeobject.h +773 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/warnings.h +20 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/weakrefobject.h +66 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/critical_section.h +16 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/datetime.h +267 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/descrobject.h +100 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/dictobject.h +108 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/dynamic_annotations.h +499 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/enumobject.h +17 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/errcode.h +45 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/exports.h +105 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/fileobject.h +41 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/fileutils.h +62 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/floatobject.h +54 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/frameobject.h +20 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/genericaliasobject.h +14 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/import.h +103 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/mimalloc/mimalloc/atomic.h +392 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/mimalloc/mimalloc/internal.h +969 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/mimalloc/mimalloc/prim.h +329 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/mimalloc/mimalloc/track.h +147 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/mimalloc/mimalloc/types.h +721 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/mimalloc/mimalloc.h +565 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_abstract.h +61 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_asdl.h +112 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_ast.h +945 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_ast_state.h +271 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_atexit.h +31 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_audit.h +35 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_backoff.h +133 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_bitutils.h +186 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_blocks_output_buffer.h +321 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_brc.h +73 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_bytes_methods.h +82 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_bytesobject.h +149 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_c_array.h +39 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_call.h +206 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_capsule.h +17 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_cell.h +75 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_ceval.h +390 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_ceval_state.h +48 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_code.h +671 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_codecs.h +76 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_compile.h +230 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_complexobject.h +34 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_condvar.h +93 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_context.h +59 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_critical_section.h +237 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_crossinterp.h +406 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_crossinterp_data_registry.h +41 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_debug_offsets.h +379 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_descrobject.h +28 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_dict.h +410 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_dict_state.h +28 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_dtoa.h +40 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_emscripten_signal.h +30 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_emscripten_trampoline.h +70 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_exceptions.h +40 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_faulthandler.h +100 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_fileutils.h +320 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_fileutils_windows.h +98 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_floatobject.h +49 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_flowgraph.h +47 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_format.h +27 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_frame.h +61 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_freelist.h +111 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_freelist_state.h +70 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_function.h +53 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_gc.h +378 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_genobject.h +43 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_getopt.h +22 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_gil.h +66 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_global_objects.h +34 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_global_objects_fini_generated.h +1592 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_global_strings.h +854 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_hamt.h +113 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_hashtable.h +150 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_import.h +141 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_importdl.h +139 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_index_pool.h +36 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_initconfig.h +197 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_instruction_sequence.h +83 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_instruments.h +127 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_interp.h +109 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_interp_structs.h +977 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_interpframe.h +401 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_interpframe_structs.h +95 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_interpolation.h +26 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_intrinsics.h +51 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_jit.h +29 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_list.h +81 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_llist.h +106 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_lock.h +236 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_long.h +319 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_magic_number.h +305 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_memoryobject.h +20 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_mimalloc.h +69 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_modsupport.h +99 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_moduleobject.h +62 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_namespace.h +21 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_object.h +1029 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_object_alloc.h +71 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_object_deferred.h +32 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_object_stack.h +95 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_object_state.h +49 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_obmalloc.h +702 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_obmalloc_init.h +66 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_opcode_metadata.h +2117 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_opcode_utils.h +90 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_optimizer.h +318 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_parking_lot.h +97 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_parser.h +78 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_pathconfig.h +26 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_pyarena.h +68 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_pyatomic_ft_wrappers.h +174 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_pybuffer.h +21 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_pyerrors.h +213 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_pyhash.h +91 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_pylifecycle.h +136 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_pymath.h +205 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_pymem.h +145 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_pymem_init.h +103 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_pystate.h +339 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_pystats.h +21 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_pythonrun.h +68 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_pythread.h +172 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_qsbr.h +172 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_range.h +21 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_runtime.h +63 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_runtime_init.h +239 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_runtime_init_generated.h +1589 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_runtime_structs.h +310 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_semaphore.h +67 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_setobject.h +41 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_signal.h +108 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_sliceobject.h +20 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_stackref.h +791 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_stats.h +97 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_strhex.h +39 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_structs.h +88 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_structseq.h +40 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_symtable.h +201 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_sysmodule.h +32 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_template.h +26 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_time.h +334 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_token.h +110 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_traceback.h +111 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_tracemalloc.h +164 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_tstate.h +88 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_tuple.h +75 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_typedefs.h +18 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_typeobject.h +155 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_typevarobject.h +28 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_ucnhash.h +36 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_unicodeobject.h +308 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_unicodeobject_generated.h +3132 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_unionobject.h +26 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_uniqueid.h +57 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_uop_ids.h +335 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_uop_metadata.h +1204 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_warnings.h +21 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_weakref.h +133 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/intrcheck.h +23 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/iterobject.h +24 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/listobject.h +55 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/lock.h +16 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/longobject.h +178 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/marshal.h +31 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/memoryobject.h +34 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/methodobject.h +146 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/modsupport.h +146 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/moduleobject.h +122 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/monitoring.h +18 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/object.h +828 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/objimpl.h +211 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/opcode.h +43 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/opcode_ids.h +259 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/osdefs.h +57 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/osmodule.h +17 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/patchlevel.h +49 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/py_curses.h +117 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/pyatomic.h +16 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/pybuffer.h +145 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/pycapsule.h +58 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/pyconfig.h +2088 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/pydtrace.h +59 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/pyerrors.h +335 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/pyexpat.h +62 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/pyframe.h +26 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/pyhash.h +59 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/pylifecycle.h +80 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/pymacconfig.h +91 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/pymacro.h +243 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/pymath.h +65 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/pymem.h +110 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/pyport.h +710 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/pystate.h +132 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/pystats.h +28 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/pystrcmp.h +23 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/pystrtod.h +37 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/pythonrun.h +42 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/pythread.h +131 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/pytypedefs.h +30 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/rangeobject.h +27 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/refcount.h +555 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/setobject.h +49 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/sliceobject.h +69 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/structmember.h +56 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/structseq.h +46 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/sysmodule.h +27 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/traceback.h +26 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/tupleobject.h +46 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/typeslots.h +96 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/unicodeobject.h +1029 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/warnings.h +45 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/weakrefobject.h +46 -0
- pytron/platforms/android/shell/app/src/main/cpp/pytron_bridge.cpp +224 -0
- pytron/platforms/android/shell/app/src/main/java/com/pytron/shell/MainActivity.kt +208 -0
- pytron/platforms/android/shell/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
- pytron/platforms/android/shell/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png +0 -0
- pytron/platforms/android/shell/build.gradle +11 -0
- pytron/platforms/android/shell/gradle/wrapper/gradle-wrapper.jar +0 -0
- pytron/platforms/android/shell/gradle/wrapper/gradle-wrapper.properties +5 -0
- pytron/platforms/android/shell/gradle.properties +2 -0
- pytron/platforms/android/shell/gradlew.bat +85 -0
- pytron/platforms/android/shell/settings.gradle +16 -0
- pytron/platforms/darwin.py +82 -0
- pytron/platforms/darwin_ops/libs.py +31 -0
- pytron/platforms/darwin_ops/system.py +182 -0
- pytron/platforms/darwin_ops/utils.py +85 -0
- pytron/platforms/darwin_ops/webview.py +5 -0
- pytron/platforms/darwin_ops/window.py +102 -0
- pytron/platforms/interface.py +152 -0
- pytron/platforms/linux.py +82 -0
- pytron/platforms/linux_ops/libs.py +49 -0
- pytron/platforms/linux_ops/system.py +316 -0
- pytron/platforms/linux_ops/utils.py +19 -0
- pytron/platforms/linux_ops/webview.py +5 -0
- pytron/platforms/linux_ops/window.py +115 -0
- pytron/platforms/windows.py +136 -0
- pytron/platforms/windows_ops/__init__.py +0 -0
- pytron/platforms/windows_ops/constants.py +126 -0
- pytron/platforms/windows_ops/system.py +518 -0
- pytron/platforms/windows_ops/utils.py +3 -0
- pytron/platforms/windows_ops/webview.py +5 -0
- pytron/platforms/windows_ops/window.py +361 -0
- pytron/plugin.py +467 -0
- pytron/rcedit-x64.exe +0 -0
- pytron/router.py +146 -0
- pytron/serializer.py +240 -0
- pytron/shortcuts.py +279 -0
- pytron/state.py +76 -0
- pytron/tray.py +399 -0
- pytron/updater.py +181 -0
- pytron/utf8_hook.py +112 -0
- pytron/utils.py +44 -0
- pytron/webview.py +722 -0
- pytron_kit-0.3.12.dist-info/METADATA +131 -0
- pytron_kit-0.3.12.dist-info/RECORD +419 -0
- pytron_kit-0.3.12.dist-info/WHEEL +5 -0
- pytron_kit-0.3.12.dist-info/entry_points.txt +2 -0
- pytron_kit-0.3.12.dist-info/licenses/LICENSE +201 -0
- pytron_kit-0.3.12.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,310 @@
|
|
|
1
|
+
/* This file contains the struct definitions for the runtime, interpreter
|
|
2
|
+
* and thread states, plus all smaller structs contained therein */
|
|
3
|
+
|
|
4
|
+
#ifndef Py_INTERNAL_RUNTIME_STRUCTS_H
|
|
5
|
+
#define Py_INTERNAL_RUNTIME_STRUCTS_H
|
|
6
|
+
#ifdef __cplusplus
|
|
7
|
+
extern "C" {
|
|
8
|
+
#endif
|
|
9
|
+
|
|
10
|
+
#include "pycore_interp_structs.h" // _PyGC_Head_UNUSED
|
|
11
|
+
#include "pycore_obmalloc.h" // struct _obmalloc_global_state
|
|
12
|
+
|
|
13
|
+
/************ Runtime state ************/
|
|
14
|
+
|
|
15
|
+
typedef struct {
|
|
16
|
+
/* We tag each block with an API ID in order to tag API violations */
|
|
17
|
+
char api_id;
|
|
18
|
+
PyMemAllocatorEx alloc;
|
|
19
|
+
} debug_alloc_api_t;
|
|
20
|
+
|
|
21
|
+
struct _pymem_allocators {
|
|
22
|
+
PyMutex mutex;
|
|
23
|
+
struct {
|
|
24
|
+
PyMemAllocatorEx raw;
|
|
25
|
+
PyMemAllocatorEx mem;
|
|
26
|
+
PyMemAllocatorEx obj;
|
|
27
|
+
} standard;
|
|
28
|
+
struct {
|
|
29
|
+
debug_alloc_api_t raw;
|
|
30
|
+
debug_alloc_api_t mem;
|
|
31
|
+
debug_alloc_api_t obj;
|
|
32
|
+
} debug;
|
|
33
|
+
int is_debug_enabled;
|
|
34
|
+
PyObjectArenaAllocator obj_arena;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
enum _py_float_format_type {
|
|
38
|
+
_py_float_format_unknown,
|
|
39
|
+
_py_float_format_ieee_big_endian,
|
|
40
|
+
_py_float_format_ieee_little_endian,
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
struct _Py_float_runtime_state {
|
|
44
|
+
enum _py_float_format_type float_format;
|
|
45
|
+
enum _py_float_format_type double_format;
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
struct pyhash_runtime_state {
|
|
49
|
+
struct {
|
|
50
|
+
#ifndef MS_WINDOWS
|
|
51
|
+
int fd;
|
|
52
|
+
dev_t st_dev;
|
|
53
|
+
ino_t st_ino;
|
|
54
|
+
#else
|
|
55
|
+
// This is a placeholder so the struct isn't empty on Windows.
|
|
56
|
+
int _not_used;
|
|
57
|
+
#endif
|
|
58
|
+
} urandom_cache;
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
#include "pycore_tracemalloc.h" // struct _tracemalloc_runtime_state
|
|
62
|
+
|
|
63
|
+
struct _fileutils_state {
|
|
64
|
+
int force_ascii;
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
#include "pycore_interpframe_structs.h" // _PyInterpreterFrame
|
|
68
|
+
#include "pycore_debug_offsets.h" // _Py_DebugOffsets
|
|
69
|
+
#include "pycore_signal.h" // struct _signals_runtime_state
|
|
70
|
+
#include "pycore_faulthandler.h" // struct _faulthandler_runtime_state
|
|
71
|
+
#include "pycore_ast.h" // struct _expr
|
|
72
|
+
|
|
73
|
+
#ifdef Py_DEBUG
|
|
74
|
+
#define _PYPEGEN_NSTATISTICS 2000
|
|
75
|
+
#endif
|
|
76
|
+
|
|
77
|
+
struct _parser_runtime_state {
|
|
78
|
+
#ifdef Py_DEBUG
|
|
79
|
+
long memo_statistics[_PYPEGEN_NSTATISTICS];
|
|
80
|
+
#ifdef Py_GIL_DISABLED
|
|
81
|
+
PyMutex mutex;
|
|
82
|
+
#endif
|
|
83
|
+
#else
|
|
84
|
+
int _not_used;
|
|
85
|
+
#endif
|
|
86
|
+
struct _expr dummy_name;
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
typedef struct {
|
|
90
|
+
PyTime_t numer;
|
|
91
|
+
PyTime_t denom;
|
|
92
|
+
} _PyTimeFraction;
|
|
93
|
+
|
|
94
|
+
struct _Py_time_runtime_state {
|
|
95
|
+
#if defined(MS_WINDOWS) || defined(__APPLE__)
|
|
96
|
+
_PyTimeFraction base;
|
|
97
|
+
#else
|
|
98
|
+
char _unused;
|
|
99
|
+
#endif
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
struct _Py_cached_objects {
|
|
104
|
+
// XXX We could statically allocate the hashtable.
|
|
105
|
+
_Py_hashtable_t *interned_strings;
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
// These would be in pycore_long.h if it weren't for an include cycle.
|
|
109
|
+
#define _PY_NSMALLPOSINTS 257
|
|
110
|
+
#define _PY_NSMALLNEGINTS 5
|
|
111
|
+
|
|
112
|
+
#include "pycore_global_strings.h" // struct _Py_global_strings
|
|
113
|
+
|
|
114
|
+
struct _Py_static_objects {
|
|
115
|
+
struct {
|
|
116
|
+
/* Small integers are preallocated in this array so that they
|
|
117
|
+
* can be shared.
|
|
118
|
+
* The integers that are preallocated are those in the range
|
|
119
|
+
* -_PY_NSMALLNEGINTS (inclusive) to _PY_NSMALLPOSINTS (exclusive).
|
|
120
|
+
*/
|
|
121
|
+
PyLongObject small_ints[_PY_NSMALLNEGINTS + _PY_NSMALLPOSINTS];
|
|
122
|
+
|
|
123
|
+
PyBytesObject bytes_empty;
|
|
124
|
+
struct {
|
|
125
|
+
PyBytesObject ob;
|
|
126
|
+
char eos;
|
|
127
|
+
} bytes_characters[256];
|
|
128
|
+
|
|
129
|
+
struct _Py_global_strings strings;
|
|
130
|
+
|
|
131
|
+
_PyGC_Head_UNUSED _tuple_empty_gc_not_used;
|
|
132
|
+
PyTupleObject tuple_empty;
|
|
133
|
+
|
|
134
|
+
_PyGC_Head_UNUSED _hamt_bitmap_node_empty_gc_not_used;
|
|
135
|
+
PyHamtNode_Bitmap hamt_bitmap_node_empty;
|
|
136
|
+
_PyContextTokenMissing context_token_missing;
|
|
137
|
+
} singletons;
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
/* Full Python runtime state */
|
|
141
|
+
|
|
142
|
+
/* _PyRuntimeState holds the global state for the CPython runtime.
|
|
143
|
+
That data is exported by the internal API as a global variable
|
|
144
|
+
(_PyRuntime, defined near the top of pylifecycle.c).
|
|
145
|
+
*/
|
|
146
|
+
struct pyruntimestate {
|
|
147
|
+
/* This field must be first to facilitate locating it by out of process
|
|
148
|
+
* debuggers. Out of process debuggers will use the offsets contained in this
|
|
149
|
+
* field to be able to locate other fields in several interpreter structures
|
|
150
|
+
* in a way that doesn't require them to know the exact layout of those
|
|
151
|
+
* structures.
|
|
152
|
+
*
|
|
153
|
+
* IMPORTANT:
|
|
154
|
+
* This struct is **NOT** backwards compatible between minor version of the
|
|
155
|
+
* interpreter and the members, order of members and size can change between
|
|
156
|
+
* minor versions. This struct is only guaranteed to be stable between patch
|
|
157
|
+
* versions for a given minor version of the interpreter.
|
|
158
|
+
*/
|
|
159
|
+
_Py_DebugOffsets debug_offsets;
|
|
160
|
+
|
|
161
|
+
/* Has been initialized to a safe state.
|
|
162
|
+
|
|
163
|
+
In order to be effective, this must be set to 0 during or right
|
|
164
|
+
after allocation. */
|
|
165
|
+
int _initialized;
|
|
166
|
+
|
|
167
|
+
/* Is running Py_PreInitialize()? */
|
|
168
|
+
int preinitializing;
|
|
169
|
+
|
|
170
|
+
/* Is Python preinitialized? Set to 1 by Py_PreInitialize() */
|
|
171
|
+
int preinitialized;
|
|
172
|
+
|
|
173
|
+
/* Is Python core initialized? Set to 1 by _Py_InitializeCore() */
|
|
174
|
+
int core_initialized;
|
|
175
|
+
|
|
176
|
+
/* Is Python fully initialized? Set to 1 by Py_Initialize() */
|
|
177
|
+
int initialized;
|
|
178
|
+
|
|
179
|
+
/* Set by Py_FinalizeEx(). Only reset to NULL if Py_Initialize()
|
|
180
|
+
is called again.
|
|
181
|
+
|
|
182
|
+
Use _PyRuntimeState_GetFinalizing() and _PyRuntimeState_SetFinalizing()
|
|
183
|
+
to access it, don't access it directly. */
|
|
184
|
+
PyThreadState *_finalizing;
|
|
185
|
+
/* The ID of the OS thread in which we are finalizing. */
|
|
186
|
+
unsigned long _finalizing_id;
|
|
187
|
+
|
|
188
|
+
struct pyinterpreters {
|
|
189
|
+
PyMutex mutex;
|
|
190
|
+
/* The linked list of interpreters, newest first. */
|
|
191
|
+
PyInterpreterState *head;
|
|
192
|
+
/* The runtime's initial interpreter, which has a special role
|
|
193
|
+
in the operation of the runtime. It is also often the only
|
|
194
|
+
interpreter. */
|
|
195
|
+
PyInterpreterState *main;
|
|
196
|
+
/* next_id is an auto-numbered sequence of small
|
|
197
|
+
integers. It gets initialized in _PyInterpreterState_Enable(),
|
|
198
|
+
which is called in Py_Initialize(), and used in
|
|
199
|
+
PyInterpreterState_New(). A negative interpreter ID
|
|
200
|
+
indicates an error occurred. The main interpreter will
|
|
201
|
+
always have an ID of 0. Overflow results in a RuntimeError.
|
|
202
|
+
If that becomes a problem later then we can adjust, e.g. by
|
|
203
|
+
using a Python int. */
|
|
204
|
+
int64_t next_id;
|
|
205
|
+
} interpreters;
|
|
206
|
+
|
|
207
|
+
/* Platform-specific identifier and PyThreadState, respectively, for the
|
|
208
|
+
main thread in the main interpreter. */
|
|
209
|
+
unsigned long main_thread;
|
|
210
|
+
PyThreadState *main_tstate;
|
|
211
|
+
|
|
212
|
+
/* ---------- IMPORTANT ---------------------------
|
|
213
|
+
The fields above this line are declared as early as
|
|
214
|
+
possible to facilitate out-of-process observability
|
|
215
|
+
tools. */
|
|
216
|
+
|
|
217
|
+
/* cross-interpreter data and utils */
|
|
218
|
+
_PyXI_global_state_t xi;
|
|
219
|
+
|
|
220
|
+
struct _pymem_allocators allocators;
|
|
221
|
+
struct _obmalloc_global_state obmalloc;
|
|
222
|
+
struct pyhash_runtime_state pyhash_state;
|
|
223
|
+
struct _pythread_runtime_state threads;
|
|
224
|
+
struct _signals_runtime_state signals;
|
|
225
|
+
|
|
226
|
+
/* Used for the thread state bound to the current thread. */
|
|
227
|
+
Py_tss_t autoTSSkey;
|
|
228
|
+
|
|
229
|
+
/* Used instead of PyThreadState.trash when there is not current tstate. */
|
|
230
|
+
Py_tss_t trashTSSkey;
|
|
231
|
+
|
|
232
|
+
PyWideStringList orig_argv;
|
|
233
|
+
|
|
234
|
+
struct _parser_runtime_state parser;
|
|
235
|
+
|
|
236
|
+
struct _atexit_runtime_state atexit;
|
|
237
|
+
|
|
238
|
+
struct _import_runtime_state imports;
|
|
239
|
+
struct _ceval_runtime_state ceval;
|
|
240
|
+
struct _gilstate_runtime_state {
|
|
241
|
+
/* bpo-26558: Flag to disable PyGILState_Check().
|
|
242
|
+
If set to non-zero, PyGILState_Check() always return 1. */
|
|
243
|
+
int check_enabled;
|
|
244
|
+
/* The single PyInterpreterState used by this process'
|
|
245
|
+
GILState implementation
|
|
246
|
+
*/
|
|
247
|
+
/* TODO: Given interp_main, it may be possible to kill this ref */
|
|
248
|
+
PyInterpreterState *autoInterpreterState;
|
|
249
|
+
} gilstate;
|
|
250
|
+
struct _getargs_runtime_state {
|
|
251
|
+
struct _PyArg_Parser *static_parsers;
|
|
252
|
+
} getargs;
|
|
253
|
+
struct _fileutils_state fileutils;
|
|
254
|
+
struct _faulthandler_runtime_state faulthandler;
|
|
255
|
+
struct _tracemalloc_runtime_state tracemalloc;
|
|
256
|
+
struct _reftracer_runtime_state ref_tracer;
|
|
257
|
+
|
|
258
|
+
// The rwmutex is used to prevent overlapping global and per-interpreter
|
|
259
|
+
// stop-the-world events. Global stop-the-world events lock the mutex
|
|
260
|
+
// exclusively (as a "writer"), while per-interpreter stop-the-world events
|
|
261
|
+
// lock it non-exclusively (as "readers").
|
|
262
|
+
_PyRWMutex stoptheworld_mutex;
|
|
263
|
+
struct _stoptheworld_state stoptheworld;
|
|
264
|
+
|
|
265
|
+
PyPreConfig preconfig;
|
|
266
|
+
|
|
267
|
+
// Audit values must be preserved when Py_Initialize()/Py_Finalize()
|
|
268
|
+
// is called multiple times.
|
|
269
|
+
Py_OpenCodeHookFunction open_code_hook;
|
|
270
|
+
void *open_code_userdata;
|
|
271
|
+
struct {
|
|
272
|
+
PyMutex mutex;
|
|
273
|
+
struct _Py_AuditHookEntry *head;
|
|
274
|
+
} audit_hooks;
|
|
275
|
+
|
|
276
|
+
struct _py_object_runtime_state object_state;
|
|
277
|
+
struct _Py_float_runtime_state float_state;
|
|
278
|
+
struct _Py_unicode_runtime_state unicode_state;
|
|
279
|
+
struct _types_runtime_state types;
|
|
280
|
+
struct _Py_time_runtime_state time;
|
|
281
|
+
|
|
282
|
+
/* All the objects that are shared by the runtime's interpreters. */
|
|
283
|
+
struct _Py_cached_objects cached_objects;
|
|
284
|
+
struct _Py_static_objects static_objects;
|
|
285
|
+
|
|
286
|
+
/* The following fields are here to avoid allocation during init.
|
|
287
|
+
The data is exposed through _PyRuntimeState pointer fields.
|
|
288
|
+
These fields should not be accessed directly outside of init.
|
|
289
|
+
|
|
290
|
+
All other _PyRuntimeState pointer fields are populated when
|
|
291
|
+
needed and default to NULL.
|
|
292
|
+
|
|
293
|
+
For now there are some exceptions to that rule, which require
|
|
294
|
+
allocation during init. These will be addressed on a case-by-case
|
|
295
|
+
basis. Most notably, we don't pre-allocated the several mutex
|
|
296
|
+
(PyThread_type_lock) fields, because on Windows we only ever get
|
|
297
|
+
a pointer type.
|
|
298
|
+
*/
|
|
299
|
+
|
|
300
|
+
/* _PyRuntimeState.interpreters.main */
|
|
301
|
+
PyInterpreterState _main_interpreter;
|
|
302
|
+
// _main_interpreter should be the last field of _PyRuntimeState.
|
|
303
|
+
// See https://github.com/python/cpython/issues/127117.
|
|
304
|
+
};
|
|
305
|
+
|
|
306
|
+
|
|
307
|
+
#ifdef __cplusplus
|
|
308
|
+
}
|
|
309
|
+
#endif
|
|
310
|
+
#endif /* Py_INTERNAL_RUNTIME_STRUCTS_H */
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
// The _PySemaphore API a simplified cross-platform semaphore used to implement
|
|
2
|
+
// wakeup/sleep.
|
|
3
|
+
#ifndef Py_INTERNAL_SEMAPHORE_H
|
|
4
|
+
#define Py_INTERNAL_SEMAPHORE_H
|
|
5
|
+
|
|
6
|
+
#ifndef Py_BUILD_CORE
|
|
7
|
+
# error "this header requires Py_BUILD_CORE define"
|
|
8
|
+
#endif
|
|
9
|
+
|
|
10
|
+
#include "pycore_pythread.h" // _POSIX_SEMAPHORES
|
|
11
|
+
|
|
12
|
+
#ifdef MS_WINDOWS
|
|
13
|
+
# ifndef WIN32_LEAN_AND_MEAN
|
|
14
|
+
# define WIN32_LEAN_AND_MEAN
|
|
15
|
+
# endif
|
|
16
|
+
# include <windows.h>
|
|
17
|
+
#elif defined(HAVE_PTHREAD_H)
|
|
18
|
+
# include <pthread.h>
|
|
19
|
+
#elif defined(HAVE_PTHREAD_STUBS)
|
|
20
|
+
# include "cpython/pthread_stubs.h"
|
|
21
|
+
#else
|
|
22
|
+
# error "Require native threads. See https://bugs.python.org/issue31370"
|
|
23
|
+
#endif
|
|
24
|
+
|
|
25
|
+
#if (defined(_POSIX_SEMAPHORES) && (_POSIX_SEMAPHORES+0) != -1 && \
|
|
26
|
+
defined(HAVE_SEM_TIMEDWAIT))
|
|
27
|
+
# define _Py_USE_SEMAPHORES
|
|
28
|
+
# include <semaphore.h>
|
|
29
|
+
#endif
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
#ifdef __cplusplus
|
|
33
|
+
extern "C" {
|
|
34
|
+
#endif
|
|
35
|
+
|
|
36
|
+
typedef struct _PySemaphore {
|
|
37
|
+
#if defined(MS_WINDOWS)
|
|
38
|
+
HANDLE platform_sem;
|
|
39
|
+
#elif defined(_Py_USE_SEMAPHORES)
|
|
40
|
+
sem_t platform_sem;
|
|
41
|
+
#else
|
|
42
|
+
pthread_mutex_t mutex;
|
|
43
|
+
pthread_cond_t cond;
|
|
44
|
+
int counter;
|
|
45
|
+
#endif
|
|
46
|
+
} _PySemaphore;
|
|
47
|
+
|
|
48
|
+
// Puts the current thread to sleep until _PySemaphore_Wakeup() is called.
|
|
49
|
+
// If `detach` is true, then the thread will detach/release the GIL while
|
|
50
|
+
// sleeping.
|
|
51
|
+
PyAPI_FUNC(int)
|
|
52
|
+
_PySemaphore_Wait(_PySemaphore *sema, PyTime_t timeout_ns, int detach);
|
|
53
|
+
|
|
54
|
+
// Wakes up a single thread waiting on sema. Note that _PySemaphore_Wakeup()
|
|
55
|
+
// can be called before _PySemaphore_Wait().
|
|
56
|
+
PyAPI_FUNC(void)
|
|
57
|
+
_PySemaphore_Wakeup(_PySemaphore *sema);
|
|
58
|
+
|
|
59
|
+
// Initializes/destroys a semaphore
|
|
60
|
+
PyAPI_FUNC(void) _PySemaphore_Init(_PySemaphore *sema);
|
|
61
|
+
PyAPI_FUNC(void) _PySemaphore_Destroy(_PySemaphore *sema);
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
#ifdef __cplusplus
|
|
65
|
+
}
|
|
66
|
+
#endif
|
|
67
|
+
#endif /* !Py_INTERNAL_SEMAPHORE_H */
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
#ifndef Py_INTERNAL_SETOBJECT_H
|
|
2
|
+
#define Py_INTERNAL_SETOBJECT_H
|
|
3
|
+
#ifdef __cplusplus
|
|
4
|
+
extern "C" {
|
|
5
|
+
#endif
|
|
6
|
+
|
|
7
|
+
#ifndef Py_BUILD_CORE
|
|
8
|
+
# error "this header requires Py_BUILD_CORE define"
|
|
9
|
+
#endif
|
|
10
|
+
|
|
11
|
+
// Export for '_abc' shared extension
|
|
12
|
+
PyAPI_FUNC(int) _PySet_NextEntry(
|
|
13
|
+
PyObject *set,
|
|
14
|
+
Py_ssize_t *pos,
|
|
15
|
+
PyObject **key,
|
|
16
|
+
Py_hash_t *hash);
|
|
17
|
+
|
|
18
|
+
// Export for '_pickle' shared extension
|
|
19
|
+
PyAPI_FUNC(int) _PySet_NextEntryRef(
|
|
20
|
+
PyObject *set,
|
|
21
|
+
Py_ssize_t *pos,
|
|
22
|
+
PyObject **key,
|
|
23
|
+
Py_hash_t *hash);
|
|
24
|
+
|
|
25
|
+
// Export for '_pickle' shared extension
|
|
26
|
+
PyAPI_FUNC(int) _PySet_Update(PyObject *set, PyObject *iterable);
|
|
27
|
+
|
|
28
|
+
// Export for the gdb plugin's (python-gdb.py) benefit
|
|
29
|
+
PyAPI_DATA(PyObject *) _PySet_Dummy;
|
|
30
|
+
|
|
31
|
+
PyAPI_FUNC(int) _PySet_Contains(PySetObject *so, PyObject *key);
|
|
32
|
+
|
|
33
|
+
// Clears the set without acquiring locks. Used by _PyCode_Fini.
|
|
34
|
+
extern void _PySet_ClearInternal(PySetObject *so);
|
|
35
|
+
|
|
36
|
+
PyAPI_FUNC(int) _PySet_AddTakeRef(PySetObject *so, PyObject *key);
|
|
37
|
+
|
|
38
|
+
#ifdef __cplusplus
|
|
39
|
+
}
|
|
40
|
+
#endif
|
|
41
|
+
#endif // !Py_INTERNAL_SETOBJECT_H
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
// Define Py_NSIG constant for signal handling.
|
|
2
|
+
|
|
3
|
+
#ifndef Py_INTERNAL_SIGNAL_H
|
|
4
|
+
#define Py_INTERNAL_SIGNAL_H
|
|
5
|
+
#ifdef __cplusplus
|
|
6
|
+
extern "C" {
|
|
7
|
+
#endif
|
|
8
|
+
|
|
9
|
+
#ifndef Py_BUILD_CORE
|
|
10
|
+
# error "this header requires Py_BUILD_CORE define"
|
|
11
|
+
#endif
|
|
12
|
+
|
|
13
|
+
#include <signal.h> // NSIG
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
// Restore signals that the interpreter has called SIG_IGN on to SIG_DFL.
|
|
17
|
+
// Export for '_posixsubprocess' shared extension.
|
|
18
|
+
PyAPI_FUNC(void) _Py_RestoreSignals(void);
|
|
19
|
+
|
|
20
|
+
#ifdef _SIG_MAXSIG
|
|
21
|
+
// gh-91145: On FreeBSD, <signal.h> defines NSIG as 32: it doesn't include
|
|
22
|
+
// realtime signals: [SIGRTMIN,SIGRTMAX]. Use _SIG_MAXSIG instead. For
|
|
23
|
+
// example on x86-64 FreeBSD 13, SIGRTMAX is 126 and _SIG_MAXSIG is 128.
|
|
24
|
+
# define Py_NSIG _SIG_MAXSIG
|
|
25
|
+
#elif defined(NSIG)
|
|
26
|
+
# define Py_NSIG NSIG
|
|
27
|
+
#elif defined(_NSIG)
|
|
28
|
+
# define Py_NSIG _NSIG // BSD/SysV
|
|
29
|
+
#elif defined(_SIGMAX)
|
|
30
|
+
# define Py_NSIG (_SIGMAX + 1) // QNX
|
|
31
|
+
#elif defined(SIGMAX)
|
|
32
|
+
# define Py_NSIG (SIGMAX + 1) // djgpp
|
|
33
|
+
#else
|
|
34
|
+
# define Py_NSIG 64 // Use a reasonable default value
|
|
35
|
+
#endif
|
|
36
|
+
|
|
37
|
+
#define INVALID_FD (-1)
|
|
38
|
+
|
|
39
|
+
struct _signals_runtime_state {
|
|
40
|
+
struct {
|
|
41
|
+
// tripped and func should be accessed using atomic ops.
|
|
42
|
+
int tripped;
|
|
43
|
+
PyObject* func;
|
|
44
|
+
} handlers[Py_NSIG];
|
|
45
|
+
|
|
46
|
+
volatile struct {
|
|
47
|
+
#ifdef MS_WINDOWS
|
|
48
|
+
/* This would be "SOCKET fd" if <winsock2.h> were always included.
|
|
49
|
+
It isn't so we must cast to SOCKET where appropriate. */
|
|
50
|
+
volatile int fd;
|
|
51
|
+
#elif defined(__VXWORKS__)
|
|
52
|
+
int fd;
|
|
53
|
+
#else
|
|
54
|
+
sig_atomic_t fd;
|
|
55
|
+
#endif
|
|
56
|
+
|
|
57
|
+
int warn_on_full_buffer;
|
|
58
|
+
#ifdef MS_WINDOWS
|
|
59
|
+
int use_send;
|
|
60
|
+
#endif
|
|
61
|
+
} wakeup;
|
|
62
|
+
|
|
63
|
+
/* Speed up sigcheck() when none tripped.
|
|
64
|
+
is_tripped should be accessed using atomic ops. */
|
|
65
|
+
int is_tripped;
|
|
66
|
+
|
|
67
|
+
/* These objects necessarily belong to the main interpreter. */
|
|
68
|
+
PyObject *default_handler;
|
|
69
|
+
PyObject *ignore_handler;
|
|
70
|
+
|
|
71
|
+
#ifdef MS_WINDOWS
|
|
72
|
+
/* This would be "HANDLE sigint_event" if <windows.h> were always included.
|
|
73
|
+
It isn't so we must cast to HANDLE everywhere "sigint_event" is used. */
|
|
74
|
+
void *sigint_event;
|
|
75
|
+
#endif
|
|
76
|
+
|
|
77
|
+
/* True if the main interpreter thread exited due to an unhandled
|
|
78
|
+
* KeyboardInterrupt exception, suggesting the user pressed ^C. */
|
|
79
|
+
int unhandled_keyboard_interrupt;
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
#ifdef MS_WINDOWS
|
|
83
|
+
# define _signals_WAKEUP_INIT \
|
|
84
|
+
{.fd = INVALID_FD, .warn_on_full_buffer = 1, .use_send = 0}
|
|
85
|
+
#else
|
|
86
|
+
# define _signals_WAKEUP_INIT \
|
|
87
|
+
{.fd = INVALID_FD, .warn_on_full_buffer = 1}
|
|
88
|
+
#endif
|
|
89
|
+
|
|
90
|
+
#define _signals_RUNTIME_INIT \
|
|
91
|
+
{ \
|
|
92
|
+
.wakeup = _signals_WAKEUP_INIT, \
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
// Export for '_multiprocessing' shared extension
|
|
97
|
+
PyAPI_FUNC(int) _PyOS_IsMainThread(void);
|
|
98
|
+
|
|
99
|
+
#ifdef MS_WINDOWS
|
|
100
|
+
// <windows.h> is not included by Python.h so use void* instead of HANDLE.
|
|
101
|
+
// Export for '_multiprocessing' shared extension
|
|
102
|
+
PyAPI_FUNC(void*) _PyOS_SigintEvent(void);
|
|
103
|
+
#endif
|
|
104
|
+
|
|
105
|
+
#ifdef __cplusplus
|
|
106
|
+
}
|
|
107
|
+
#endif
|
|
108
|
+
#endif // !Py_INTERNAL_SIGNAL_H
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
#ifndef Py_INTERNAL_SLICEOBJECT_H
|
|
2
|
+
#define Py_INTERNAL_SLICEOBJECT_H
|
|
3
|
+
#ifdef __cplusplus
|
|
4
|
+
extern "C" {
|
|
5
|
+
#endif
|
|
6
|
+
|
|
7
|
+
#ifndef Py_BUILD_CORE
|
|
8
|
+
# error "this header requires Py_BUILD_CORE define"
|
|
9
|
+
#endif
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
/* runtime lifecycle */
|
|
13
|
+
|
|
14
|
+
PyAPI_FUNC(PyObject *)
|
|
15
|
+
_PyBuildSlice_ConsumeRefs(PyObject *start, PyObject *stop);
|
|
16
|
+
|
|
17
|
+
#ifdef __cplusplus
|
|
18
|
+
}
|
|
19
|
+
#endif
|
|
20
|
+
#endif /* !Py_INTERNAL_SLICEOBJECT_H */
|