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,402 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import sys
|
|
3
|
+
import shutil
|
|
4
|
+
import subprocess
|
|
5
|
+
import json
|
|
6
|
+
from pathlib import Path
|
|
7
|
+
from ..console import log, run_command_with_output
|
|
8
|
+
from ..commands.helpers import get_python_executable
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
def find_makensis() -> str | None:
|
|
12
|
+
path = shutil.which("makensis")
|
|
13
|
+
if path:
|
|
14
|
+
return path
|
|
15
|
+
common_paths = [
|
|
16
|
+
r"C:\Program Files (x86)\NSIS\makensis.exe",
|
|
17
|
+
r"C:\Program Files\NSIS\makensis.exe",
|
|
18
|
+
]
|
|
19
|
+
for p in common_paths:
|
|
20
|
+
if os.path.exists(p):
|
|
21
|
+
return p
|
|
22
|
+
return None
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
def build_windows_installer(
|
|
26
|
+
out_name: str, script_dir: Path, app_icon: str | None
|
|
27
|
+
) -> int:
|
|
28
|
+
log("Building Windows installer (NSIS)...", style="info")
|
|
29
|
+
makensis = find_makensis()
|
|
30
|
+
if not makensis:
|
|
31
|
+
log(
|
|
32
|
+
"NSIS (makensis) not found. Checking for bundled installer...",
|
|
33
|
+
style="warning",
|
|
34
|
+
)
|
|
35
|
+
|
|
36
|
+
# Try to find bundled installer in pytron root
|
|
37
|
+
# We need to find package root. Assuming this file is in pytron/pack/
|
|
38
|
+
# So parent.parent is pytron package dir.
|
|
39
|
+
# But we need the root of the repo/install.
|
|
40
|
+
# Let's use import to find package location
|
|
41
|
+
import pytron
|
|
42
|
+
|
|
43
|
+
if pytron.__file__:
|
|
44
|
+
pkg_root = Path(pytron.__file__).resolve().parent.parent
|
|
45
|
+
else:
|
|
46
|
+
pkg_root = Path.cwd() # Fallback
|
|
47
|
+
|
|
48
|
+
possible_installers = [
|
|
49
|
+
pkg_root / "nsis-setup.exe",
|
|
50
|
+
]
|
|
51
|
+
|
|
52
|
+
nsis_setup = None
|
|
53
|
+
for installer in possible_installers:
|
|
54
|
+
if installer.exists():
|
|
55
|
+
nsis_setup = installer
|
|
56
|
+
break
|
|
57
|
+
|
|
58
|
+
if nsis_setup:
|
|
59
|
+
log(f"Found bundled NSIS installer at {nsis_setup}")
|
|
60
|
+
log(
|
|
61
|
+
"Launching NSIS installer... Please complete the installation to proceed.",
|
|
62
|
+
style="warning",
|
|
63
|
+
)
|
|
64
|
+
try:
|
|
65
|
+
# Run the installer and wait
|
|
66
|
+
subprocess.run([str(nsis_setup)], check=True)
|
|
67
|
+
log("NSIS installer finished. Re-checking for makensis...")
|
|
68
|
+
makensis = find_makensis()
|
|
69
|
+
if makensis:
|
|
70
|
+
log(
|
|
71
|
+
f"NSIS successfully installed and found at: {makensis}",
|
|
72
|
+
style="success",
|
|
73
|
+
)
|
|
74
|
+
except Exception as e:
|
|
75
|
+
log(f"Error running NSIS installer: {e}", style="error")
|
|
76
|
+
else:
|
|
77
|
+
log("Bundled NSIS installer NOT found.", style="dim")
|
|
78
|
+
|
|
79
|
+
if not makensis:
|
|
80
|
+
log(
|
|
81
|
+
"Error: makensis not found. Please install NSIS and add it to PATH.",
|
|
82
|
+
style="error",
|
|
83
|
+
)
|
|
84
|
+
return 1
|
|
85
|
+
|
|
86
|
+
# Locate the generated build directory and exe
|
|
87
|
+
dist_dir = Path("dist")
|
|
88
|
+
# In onedir mode, output is dist/AppName
|
|
89
|
+
build_dir = dist_dir / out_name
|
|
90
|
+
exe_file = build_dir / f"{out_name}.exe"
|
|
91
|
+
|
|
92
|
+
if not build_dir.exists() or not exe_file.exists():
|
|
93
|
+
log(
|
|
94
|
+
f"Error: Could not find generated build directory or executable in {dist_dir}",
|
|
95
|
+
style="error",
|
|
96
|
+
)
|
|
97
|
+
return 1
|
|
98
|
+
|
|
99
|
+
# Locate the NSIS script
|
|
100
|
+
nsi_script = Path("installer.nsi")
|
|
101
|
+
if not nsi_script.exists():
|
|
102
|
+
if Path("installer/Installation.nsi").exists():
|
|
103
|
+
nsi_script = Path("installer/Installation.nsi")
|
|
104
|
+
else:
|
|
105
|
+
# Check inside the pytron package
|
|
106
|
+
try:
|
|
107
|
+
import pytron
|
|
108
|
+
|
|
109
|
+
if pytron.__file__ is not None:
|
|
110
|
+
pkg_root = Path(pytron.__file__).resolve().parent
|
|
111
|
+
pkg_nsi = pkg_root / "installer" / "Installation.nsi"
|
|
112
|
+
if pkg_nsi.exists():
|
|
113
|
+
nsi_script = pkg_nsi
|
|
114
|
+
except ImportError:
|
|
115
|
+
pass
|
|
116
|
+
|
|
117
|
+
if not nsi_script.exists():
|
|
118
|
+
print(
|
|
119
|
+
"Error: installer.nsi not found. Please create one or place it in the current directory."
|
|
120
|
+
)
|
|
121
|
+
return 1
|
|
122
|
+
|
|
123
|
+
build_dir_abs = build_dir.resolve()
|
|
124
|
+
|
|
125
|
+
# Get metadata from settings
|
|
126
|
+
version = "1.0"
|
|
127
|
+
author = "Pytron User"
|
|
128
|
+
description = f"{out_name} Application"
|
|
129
|
+
copyright = f"Copyright © 2025 {author}"
|
|
130
|
+
signing_config = {}
|
|
131
|
+
|
|
132
|
+
try:
|
|
133
|
+
settings_path = script_dir / "settings.json"
|
|
134
|
+
if settings_path.exists():
|
|
135
|
+
settings = json.loads(settings_path.read_text())
|
|
136
|
+
version = settings.get("version", "1.0")
|
|
137
|
+
author = settings.get("author", author)
|
|
138
|
+
description = settings.get("description", description)
|
|
139
|
+
copyright = settings.get("copyright", copyright)
|
|
140
|
+
signing_config = settings.get("signing", {})
|
|
141
|
+
except Exception as e:
|
|
142
|
+
log(f"Warning reading settings: {e}", style="warning")
|
|
143
|
+
|
|
144
|
+
cmd_nsis = [
|
|
145
|
+
makensis,
|
|
146
|
+
f"/DNAME={out_name}",
|
|
147
|
+
f"/DVERSION={version}",
|
|
148
|
+
f"/DCOMPANY={author}",
|
|
149
|
+
f"/DDESCRIPTION={description}",
|
|
150
|
+
f"/DCOPYRIGHT={copyright}",
|
|
151
|
+
f"/DBUILD_DIR={build_dir_abs}",
|
|
152
|
+
f"/DMAIN_EXE_NAME={out_name}.exe",
|
|
153
|
+
f"/DOUT_DIR={script_dir.resolve()}",
|
|
154
|
+
]
|
|
155
|
+
|
|
156
|
+
# Pass icon to NSIS if available
|
|
157
|
+
if app_icon:
|
|
158
|
+
abs_icon = Path(app_icon).resolve()
|
|
159
|
+
# Wrap in quotes in case of spaces
|
|
160
|
+
cmd_nsis.append(f"/DMUI_ICON={abs_icon}")
|
|
161
|
+
cmd_nsis.append(f"/DMUI_UNICON={abs_icon}")
|
|
162
|
+
# NSIS expects switches (like /V4) before the script filename; place verbosity
|
|
163
|
+
# flag before the script so it's honored.
|
|
164
|
+
cmd_nsis.append(f"/V4")
|
|
165
|
+
cmd_nsis.append(str(nsi_script))
|
|
166
|
+
log(f"Running NSIS: {' '.join(cmd_nsis)}", style="dim")
|
|
167
|
+
|
|
168
|
+
ret = run_command_with_output(cmd_nsis, style="dim")
|
|
169
|
+
if ret != 0:
|
|
170
|
+
return ret
|
|
171
|
+
|
|
172
|
+
# Installer path (based on NSIS script logic)
|
|
173
|
+
installer_path = script_dir / f"{out_name}_Installer_{version}.exe"
|
|
174
|
+
|
|
175
|
+
# Signing Logic
|
|
176
|
+
if signing_config and installer_path.exists():
|
|
177
|
+
if "certificate" in signing_config:
|
|
178
|
+
cert_path = script_dir / signing_config["certificate"]
|
|
179
|
+
password = signing_config.get("password")
|
|
180
|
+
|
|
181
|
+
if cert_path.exists():
|
|
182
|
+
log(f"Signing installer: {installer_path.name}")
|
|
183
|
+
# Try to find signtool
|
|
184
|
+
signtool = shutil.which("signtool")
|
|
185
|
+
|
|
186
|
+
# Check common paths if not in PATH
|
|
187
|
+
if not signtool:
|
|
188
|
+
common_sign_paths = [
|
|
189
|
+
r"C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x64\signtool.exe",
|
|
190
|
+
r"C:\Program Files (x86)\Windows Kits\10\bin\x64\signtool.exe",
|
|
191
|
+
r"C:\Program Files (x86)\Windows Kits\8.1\bin\x64\signtool.exe",
|
|
192
|
+
]
|
|
193
|
+
for p in common_sign_paths:
|
|
194
|
+
if os.path.exists(p):
|
|
195
|
+
signtool = p
|
|
196
|
+
break
|
|
197
|
+
|
|
198
|
+
if signtool:
|
|
199
|
+
sign_cmd = [
|
|
200
|
+
signtool,
|
|
201
|
+
"sign",
|
|
202
|
+
"/f",
|
|
203
|
+
str(cert_path),
|
|
204
|
+
"/fd",
|
|
205
|
+
"SHA256",
|
|
206
|
+
"/tr",
|
|
207
|
+
"http://timestamp.digicert.com",
|
|
208
|
+
"/td",
|
|
209
|
+
"SHA256",
|
|
210
|
+
]
|
|
211
|
+
if password:
|
|
212
|
+
sign_cmd.extend(["/p", password])
|
|
213
|
+
sign_cmd.append(str(installer_path))
|
|
214
|
+
|
|
215
|
+
try:
|
|
216
|
+
subprocess.run(sign_cmd, check=True)
|
|
217
|
+
log("Installer signed successfully!", style="success")
|
|
218
|
+
except Exception as e:
|
|
219
|
+
log(f"Signing failed: {e}", style="error")
|
|
220
|
+
else:
|
|
221
|
+
log(
|
|
222
|
+
"Warning: 'signtool' not found. Cannot sign the installer.",
|
|
223
|
+
style="warning",
|
|
224
|
+
)
|
|
225
|
+
else:
|
|
226
|
+
log(f"Warning: Certificate not found at {cert_path}", style="warning")
|
|
227
|
+
|
|
228
|
+
return ret
|
|
229
|
+
|
|
230
|
+
|
|
231
|
+
def build_mac_installer(out_name: str, script_dir: Path, app_icon: str | None) -> int:
|
|
232
|
+
log("Building macOS installer (DMG)...")
|
|
233
|
+
|
|
234
|
+
# Check for dmgbuild
|
|
235
|
+
if not shutil.which("dmgbuild"):
|
|
236
|
+
log("'dmgbuild' not found. Attempting to install it...", style="warning")
|
|
237
|
+
try:
|
|
238
|
+
subprocess.check_call(
|
|
239
|
+
[get_python_executable(), "-m", "pip", "install", "dmgbuild"]
|
|
240
|
+
)
|
|
241
|
+
log("'dmgbuild' installed successfully.", style="success")
|
|
242
|
+
except subprocess.CalledProcessError:
|
|
243
|
+
log(
|
|
244
|
+
"Failed to install 'dmgbuild'. Please install it manually: pip install dmgbuild",
|
|
245
|
+
style="error",
|
|
246
|
+
)
|
|
247
|
+
log("Skipping DMG creation. Your .app bundle is in dist/", style="warning")
|
|
248
|
+
return 0
|
|
249
|
+
|
|
250
|
+
app_bundle = Path("dist") / f"{out_name}.app"
|
|
251
|
+
if not app_bundle.exists():
|
|
252
|
+
log(f"Error: .app bundle not found at {app_bundle}", style="error")
|
|
253
|
+
return 1
|
|
254
|
+
|
|
255
|
+
dmg_name = f"{out_name}.dmg"
|
|
256
|
+
dmg_path = Path("dist") / dmg_name
|
|
257
|
+
|
|
258
|
+
# Generate settings file for dmgbuild
|
|
259
|
+
settings_file = Path("build") / "dmg_settings.py"
|
|
260
|
+
settings_file.parent.mkdir(parents=True, exist_ok=True)
|
|
261
|
+
|
|
262
|
+
with open(settings_file, "w") as f:
|
|
263
|
+
f.write(f"files = [r'{str(app_bundle)}']\n")
|
|
264
|
+
f.write("symlinks = {'Applications': '/Applications'}\n")
|
|
265
|
+
if app_icon and Path(app_icon).suffix == ".icns":
|
|
266
|
+
f.write(f"icon = r'{app_icon}'\n")
|
|
267
|
+
f.write(f"badge_icon = r'{app_icon}'\n")
|
|
268
|
+
|
|
269
|
+
cmd = ["dmgbuild", "-s", str(settings_file), out_name, str(dmg_path)]
|
|
270
|
+
log(f"Running: {' '.join(cmd)}", style="dim")
|
|
271
|
+
return subprocess.call(cmd)
|
|
272
|
+
|
|
273
|
+
|
|
274
|
+
def build_linux_installer(out_name: str, script_dir: Path, app_icon: str | None) -> int:
|
|
275
|
+
log("Building Linux installer (.deb package)...")
|
|
276
|
+
|
|
277
|
+
# Check for dpkg-deb
|
|
278
|
+
if not shutil.which("dpkg-deb"):
|
|
279
|
+
log("Error: 'dpkg-deb' not found. Cannot build .deb package.", style="error")
|
|
280
|
+
log(
|
|
281
|
+
"Ensure you are on a Debian-based system (Ubuntu, Kali, Pop!_OS, etc.)",
|
|
282
|
+
style="warning",
|
|
283
|
+
)
|
|
284
|
+
return 1
|
|
285
|
+
|
|
286
|
+
# Get metadata
|
|
287
|
+
version = "1.0"
|
|
288
|
+
author = "Pytron User"
|
|
289
|
+
description = f"{out_name} Application"
|
|
290
|
+
try:
|
|
291
|
+
settings_path = script_dir / "settings.json"
|
|
292
|
+
if settings_path.exists():
|
|
293
|
+
settings = json.loads(settings_path.read_text())
|
|
294
|
+
version = settings.get("version", "1.0")
|
|
295
|
+
author = settings.get("author", author)
|
|
296
|
+
description = settings.get("description", description)
|
|
297
|
+
except Exception as e:
|
|
298
|
+
log(f"Debug: Failed to load settings.json for linux build: {e}", style="dim")
|
|
299
|
+
|
|
300
|
+
# Clean version for Debian (digits, dots, plus, tilde)
|
|
301
|
+
deb_version = "".join(c for c in version if c.isalnum() or c in ".-+~")
|
|
302
|
+
if not deb_version[0].isdigit():
|
|
303
|
+
deb_version = "0." + deb_version
|
|
304
|
+
|
|
305
|
+
# Prepare directories
|
|
306
|
+
package_name = out_name.lower().replace(" ", "-").replace("_", "-")
|
|
307
|
+
build_root = Path("build") / "deb_package"
|
|
308
|
+
if build_root.exists():
|
|
309
|
+
shutil.rmtree(build_root)
|
|
310
|
+
|
|
311
|
+
install_dir = build_root / "opt" / package_name
|
|
312
|
+
bin_dir = build_root / "usr" / "bin"
|
|
313
|
+
desktop_dir = build_root / "usr" / "share" / "applications"
|
|
314
|
+
debian_dir = build_root / "DEBIAN"
|
|
315
|
+
|
|
316
|
+
for d in [install_dir, bin_dir, desktop_dir, debian_dir]:
|
|
317
|
+
d.mkdir(parents=True, exist_ok=True)
|
|
318
|
+
|
|
319
|
+
# 1. Copy Application Files
|
|
320
|
+
# Source is dist/out_name (onedir mode)
|
|
321
|
+
src_dir = Path("dist") / out_name
|
|
322
|
+
if not src_dir.exists():
|
|
323
|
+
log(f"Error: Source build dir {src_dir} not found.", style="error")
|
|
324
|
+
return 1
|
|
325
|
+
|
|
326
|
+
log(f"Copying files to {install_dir}...")
|
|
327
|
+
shutil.copytree(src_dir, install_dir, dirs_exist_ok=True)
|
|
328
|
+
|
|
329
|
+
# 2. Create Symlink in /usr/bin
|
|
330
|
+
# relative symlink: ../../opt/package_name/out_name
|
|
331
|
+
# But we are creating the structure, so we just create a broken link or a script.
|
|
332
|
+
# Actually, a wrapper script is safer for environment variables.
|
|
333
|
+
wrapper_script = bin_dir / package_name
|
|
334
|
+
wrapper_script.write_text(f'#!/bin/sh\nexec /opt/{package_name}/{out_name} "$@"\n')
|
|
335
|
+
wrapper_script.chmod(0o755)
|
|
336
|
+
|
|
337
|
+
# 3. Create .desktop file
|
|
338
|
+
icon_name = package_name
|
|
339
|
+
if app_icon and Path(app_icon).exists():
|
|
340
|
+
# Install icon to /usr/share/icons/hicolor/256x256/apps/
|
|
341
|
+
icon_path = Path(app_icon)
|
|
342
|
+
icon_dest_dir = (
|
|
343
|
+
build_root / "usr" / "share" / "icons" / "hicolor" / "256x256" / "apps"
|
|
344
|
+
)
|
|
345
|
+
icon_dest_dir.mkdir(parents=True, exist_ok=True)
|
|
346
|
+
# Convert if needed? explicit .png is best. Assume user provided decent icon or we just copy.
|
|
347
|
+
ext = icon_path.suffix
|
|
348
|
+
if ext == ".ico":
|
|
349
|
+
# Try simple copy, Linux often handles it, but png preferred.
|
|
350
|
+
pass
|
|
351
|
+
shutil.copy(icon_path, icon_dest_dir / (package_name + ext))
|
|
352
|
+
icon_name = package_name # without extension works usually if matched name
|
|
353
|
+
|
|
354
|
+
desktop_content = f"""[Desktop Entry]
|
|
355
|
+
Name={out_name}
|
|
356
|
+
Comment={description}
|
|
357
|
+
Exec=/opt/{package_name}/{out_name}
|
|
358
|
+
Icon={icon_name}
|
|
359
|
+
Terminal=false
|
|
360
|
+
Type=Application
|
|
361
|
+
Categories=Utility;
|
|
362
|
+
"""
|
|
363
|
+
(desktop_dir / f"{package_name}.desktop").write_text(desktop_content)
|
|
364
|
+
|
|
365
|
+
# 4. Control File
|
|
366
|
+
control_content = f"""Package: {package_name}
|
|
367
|
+
Version: {deb_version}
|
|
368
|
+
Section: utils
|
|
369
|
+
Priority: optional
|
|
370
|
+
Architecture: amd64
|
|
371
|
+
Maintainer: {author}
|
|
372
|
+
Description: {description}
|
|
373
|
+
Built with Pytron.
|
|
374
|
+
"""
|
|
375
|
+
(debian_dir / "control").write_text(control_content)
|
|
376
|
+
|
|
377
|
+
# 5. Build .deb
|
|
378
|
+
deb_filename = f"{package_name}_{deb_version}_amd64.deb"
|
|
379
|
+
output_deb = script_dir / deb_filename
|
|
380
|
+
|
|
381
|
+
cmd = ["dpkg-deb", "--build", str(build_root), str(output_deb)]
|
|
382
|
+
log(f"Running: {' '.join(cmd)}", style="dim")
|
|
383
|
+
result = subprocess.call(cmd)
|
|
384
|
+
|
|
385
|
+
if result == 0:
|
|
386
|
+
log(f"Linux .deb package created: {output_deb}", style="success")
|
|
387
|
+
else:
|
|
388
|
+
log("Failed to create .deb package.", style="error")
|
|
389
|
+
|
|
390
|
+
return result
|
|
391
|
+
|
|
392
|
+
|
|
393
|
+
def build_installer(out_name: str, script_dir: Path, app_icon: str | None) -> int:
|
|
394
|
+
if sys.platform == "win32":
|
|
395
|
+
return build_windows_installer(out_name, script_dir, app_icon)
|
|
396
|
+
elif sys.platform == "darwin":
|
|
397
|
+
return build_mac_installer(out_name, script_dir, app_icon)
|
|
398
|
+
elif sys.platform == "linux":
|
|
399
|
+
return build_linux_installer(out_name, script_dir, app_icon)
|
|
400
|
+
else:
|
|
401
|
+
log(f"Installer creation not supported on {sys.platform} yet.", style="warning")
|
|
402
|
+
return 0
|