machineconfig 1.95__py3-none-any.whl → 1.96__py3-none-any.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.
Potentially problematic release.
This version of machineconfig might be problematic. Click here for more details.
- machineconfig/cluster/cloud_manager.py +445 -343
- machineconfig/cluster/data_transfer.py +63 -57
- machineconfig/cluster/distribute.py +284 -280
- machineconfig/cluster/file_manager.py +234 -237
- machineconfig/cluster/job_params.py +133 -133
- machineconfig/cluster/loader_runner.py +183 -149
- machineconfig/cluster/remote_machine.py +269 -252
- machineconfig/cluster/script_execution.py +215 -209
- machineconfig/cluster/script_notify_upon_completion.py +50 -43
- machineconfig/cluster/self_ssh.py +52 -54
- machineconfig/cluster/sessions_managers/__init__.py +0 -0
- machineconfig/cluster/sessions_managers/archive/__init__.py +0 -0
- machineconfig/{jobs/python → cluster/sessions_managers/archive}/create_zellij_template.py +5 -3
- machineconfig/cluster/sessions_managers/archive/session_managers.py +184 -0
- machineconfig/cluster/sessions_managers/demo_rich_zellij.py +0 -0
- machineconfig/cluster/sessions_managers/enhanced_command_runner.py +160 -0
- machineconfig/cluster/sessions_managers/wt_local.py +494 -0
- machineconfig/cluster/sessions_managers/wt_local_manager.py +577 -0
- machineconfig/cluster/sessions_managers/wt_remote.py +288 -0
- machineconfig/cluster/sessions_managers/wt_remote_manager.py +483 -0
- machineconfig/cluster/sessions_managers/wt_utils/layout_generator.py +196 -0
- machineconfig/cluster/sessions_managers/wt_utils/process_monitor.py +418 -0
- machineconfig/cluster/sessions_managers/wt_utils/remote_executor.py +175 -0
- machineconfig/cluster/sessions_managers/wt_utils/session_manager.py +300 -0
- machineconfig/cluster/sessions_managers/wt_utils/status_reporter.py +228 -0
- machineconfig/cluster/sessions_managers/zellij_local.py +418 -0
- machineconfig/cluster/sessions_managers/zellij_local_manager.py +533 -0
- machineconfig/cluster/sessions_managers/zellij_remote.py +229 -0
- machineconfig/cluster/sessions_managers/zellij_remote_manager.py +188 -0
- machineconfig/cluster/sessions_managers/zellij_utils/example_usage.py +64 -0
- machineconfig/cluster/sessions_managers/zellij_utils/layout_generator.py +126 -0
- machineconfig/cluster/sessions_managers/zellij_utils/process_monitor.py +334 -0
- machineconfig/cluster/sessions_managers/zellij_utils/remote_executor.py +68 -0
- machineconfig/cluster/sessions_managers/zellij_utils/session_manager.py +119 -0
- machineconfig/cluster/sessions_managers/zellij_utils/status_reporter.py +85 -0
- machineconfig/cluster/templates/cli_click.py +0 -1
- machineconfig/cluster/templates/cli_gooey.py +102 -104
- machineconfig/cluster/templates/run_cloud.py +51 -51
- machineconfig/cluster/templates/run_cluster.py +103 -59
- machineconfig/cluster/templates/run_remote.py +57 -58
- machineconfig/cluster/templates/utils.py +69 -36
- machineconfig/jobs/__pycache__/__init__.cpython-311.pyc +0 -0
- machineconfig/jobs/python/__pycache__/__init__.cpython-311.pyc +0 -0
- machineconfig/jobs/python/check_installations.py +258 -190
- machineconfig/jobs/python/create_bootable_media.py +7 -3
- machineconfig/jobs/python/python_cargo_build_share.py +50 -50
- machineconfig/jobs/python/python_ve_symlink.py +6 -6
- machineconfig/jobs/python/vscode/__pycache__/select_interpreter.cpython-311.pyc +0 -0
- machineconfig/jobs/python/vscode/api.py +1 -1
- machineconfig/jobs/python/vscode/link_ve.py +2 -2
- machineconfig/jobs/python/vscode/select_interpreter.py +9 -5
- machineconfig/jobs/python/vscode/sync_code.py +8 -5
- machineconfig/jobs/python_custom_installers/__pycache__/__init__.cpython-311.pyc +0 -0
- machineconfig/jobs/python_custom_installers/archive/ngrok.py +1 -1
- machineconfig/jobs/python_custom_installers/dev/alacritty.py +3 -2
- machineconfig/jobs/python_custom_installers/dev/brave.py +7 -3
- machineconfig/jobs/python_custom_installers/dev/bypass_paywall.py +3 -4
- machineconfig/jobs/python_custom_installers/dev/code.py +3 -1
- machineconfig/jobs/python_custom_installers/dev/cursor.py +66 -5
- machineconfig/jobs/python_custom_installers/dev/docker_desktop.py +0 -1
- machineconfig/jobs/python_custom_installers/dev/espanso.py +13 -9
- machineconfig/jobs/python_custom_installers/dev/goes.py +2 -8
- machineconfig/jobs/python_custom_installers/dev/lvim.py +3 -2
- machineconfig/jobs/python_custom_installers/dev/nerdfont.py +1 -1
- machineconfig/jobs/python_custom_installers/dev/redis.py +7 -3
- machineconfig/jobs/python_custom_installers/dev/wezterm.py +8 -4
- machineconfig/jobs/python_custom_installers/dev/winget.py +194 -0
- machineconfig/jobs/python_custom_installers/{dev/docker.py → docker.py} +8 -3
- machineconfig/jobs/python_custom_installers/gh.py +4 -3
- machineconfig/jobs/python_custom_installers/hx.py +9 -8
- machineconfig/jobs/python_custom_installers/scripts/linux/vscode.sh +97 -30
- machineconfig/jobs/python_custom_installers/{dev/warp-cli.py → warp-cli.py} +1 -1
- machineconfig/jobs/python_generic_installers/__pycache__/__init__.cpython-311.pyc +0 -0
- machineconfig/jobs/python_generic_installers/config.json +133 -9
- machineconfig/jobs/python_generic_installers/dev/config.json +208 -37
- machineconfig/jobs/python_generic_installers/update.py +3 -0
- machineconfig/jobs/python_linux_installers/__pycache__/__init__.cpython-311.pyc +0 -0
- machineconfig/jobs/python_linux_installers/config.json +42 -6
- machineconfig/jobs/python_linux_installers/dev/config.json +79 -11
- machineconfig/jobs/python_windows_installers/config.json +6 -0
- machineconfig/profile/__pycache__/__init__.cpython-311.pyc +0 -0
- machineconfig/profile/__pycache__/create.cpython-311.pyc +0 -0
- machineconfig/profile/__pycache__/shell.cpython-311.pyc +0 -0
- machineconfig/profile/create.py +5 -5
- machineconfig/profile/create_hardlinks.py +5 -5
- machineconfig/profile/shell.py +44 -17
- machineconfig/scripts/__pycache__/__init__.cpython-311.pyc +0 -0
- machineconfig/scripts/__pycache__/__init__.cpython-313.pyc +0 -0
- machineconfig/scripts/linux/fire_agents +27 -0
- machineconfig/scripts/linux/wifi_conn +24 -0
- machineconfig/scripts/python/__pycache__/__init__.cpython-311.pyc +0 -0
- machineconfig/scripts/python/__pycache__/__init__.cpython-313.pyc +0 -0
- machineconfig/scripts/python/__pycache__/cloud_copy.cpython-311.pyc +0 -0
- machineconfig/scripts/python/__pycache__/cloud_mount.cpython-311.pyc +0 -0
- machineconfig/scripts/python/__pycache__/cloud_sync.cpython-311.pyc +0 -0
- machineconfig/scripts/python/__pycache__/croshell.cpython-311.pyc +0 -0
- machineconfig/scripts/python/__pycache__/devops.cpython-311.pyc +0 -0
- machineconfig/scripts/python/__pycache__/devops_backup_retrieve.cpython-311.pyc +0 -0
- machineconfig/scripts/python/__pycache__/devops_devapps_install.cpython-311.pyc +0 -0
- machineconfig/scripts/python/__pycache__/devops_update_repos.cpython-311.pyc +0 -0
- machineconfig/scripts/python/__pycache__/fire_agents.cpython-311.pyc +0 -0
- machineconfig/scripts/python/__pycache__/fire_jobs.cpython-311.pyc +0 -0
- machineconfig/scripts/python/__pycache__/fire_jobs.cpython-313.pyc +0 -0
- machineconfig/scripts/python/__pycache__/get_zellij_cmd.cpython-311.pyc +0 -0
- machineconfig/scripts/python/__pycache__/repos.cpython-311.pyc +0 -0
- machineconfig/scripts/python/archive/im2text.py +1 -3
- machineconfig/scripts/python/choose_wezterm_theme.py +3 -3
- machineconfig/scripts/python/cloud_copy.py +10 -10
- machineconfig/scripts/python/cloud_manager.py +77 -99
- machineconfig/scripts/python/cloud_mount.py +13 -12
- machineconfig/scripts/python/cloud_repo_sync.py +14 -11
- machineconfig/scripts/python/croshell.py +24 -21
- machineconfig/scripts/python/devops.py +12 -17
- machineconfig/scripts/python/devops_add_identity.py +32 -10
- machineconfig/scripts/python/devops_add_ssh_key.py +10 -10
- machineconfig/scripts/python/devops_backup_retrieve.py +9 -8
- machineconfig/scripts/python/devops_devapps_install.py +6 -6
- machineconfig/scripts/python/devops_update_repos.py +4 -3
- machineconfig/scripts/python/dotfile.py +10 -7
- machineconfig/scripts/python/fire_agents.py +69 -0
- machineconfig/scripts/python/fire_jobs.py +56 -65
- machineconfig/scripts/python/ftpx.py +8 -8
- machineconfig/scripts/python/get_zellij_cmd.py +3 -3
- machineconfig/scripts/python/gh_models.py +6 -4
- machineconfig/scripts/python/helpers/__pycache__/__init__.cpython-311.pyc +0 -0
- machineconfig/scripts/python/helpers/__pycache__/__init__.cpython-313.pyc +0 -0
- machineconfig/scripts/python/helpers/__pycache__/cloud_helpers.cpython-311.pyc +0 -0
- machineconfig/scripts/python/helpers/__pycache__/helpers2.cpython-311.pyc +0 -0
- machineconfig/scripts/python/helpers/__pycache__/helpers4.cpython-311.pyc +0 -0
- machineconfig/scripts/python/helpers/__pycache__/helpers4.cpython-313.pyc +0 -0
- machineconfig/scripts/python/helpers/__pycache__/repo_sync_helpers.cpython-311.pyc +0 -0
- machineconfig/scripts/python/helpers/cloud_helpers.py +12 -12
- machineconfig/scripts/python/helpers/helpers2.py +9 -8
- machineconfig/scripts/python/helpers/helpers4.py +23 -35
- machineconfig/scripts/python/helpers/repo_sync_helpers.py +17 -16
- machineconfig/scripts/python/mount_nfs.py +8 -11
- machineconfig/scripts/python/mount_nw_drive.py +4 -4
- machineconfig/scripts/python/mount_ssh.py +2 -2
- machineconfig/scripts/python/onetimeshare.py +56 -57
- machineconfig/scripts/python/pomodoro.py +55 -55
- machineconfig/scripts/python/repos.py +26 -18
- machineconfig/scripts/python/scheduler.py +70 -53
- machineconfig/scripts/python/snapshot.py +21 -24
- machineconfig/scripts/python/start_slidev.py +6 -5
- machineconfig/scripts/python/start_terminals.py +3 -1
- machineconfig/scripts/python/viewer.py +5 -4
- machineconfig/scripts/python/viewer_template.py +138 -140
- machineconfig/scripts/python/wifi_conn.py +412 -60
- machineconfig/scripts/python/wsl_windows_transfer.py +18 -3
- machineconfig/settings/linters/.pylintrc +6 -7
- machineconfig/settings/lvim/windows/config.lua +0 -0
- machineconfig/settings/shells/bash/init.sh +6 -0
- machineconfig/settings/shells/ipy/profiles/default/startup/playext.py +7 -6
- machineconfig/settings/shells/pwsh/init.ps1 +6 -6
- machineconfig/settings/shells/wt/settings.json +51 -266
- machineconfig/setup_linux/web_shortcuts/interactive.sh +5 -2
- machineconfig/setup_windows/wt_and_pwsh/set_pwsh_theme.py +3 -6
- machineconfig/setup_windows/wt_and_pwsh/set_wt_settings.py +11 -9
- machineconfig/utils/ai/url2md.py +2 -2
- machineconfig/utils/cloud/onedrive/setup_oauth.py +59 -0
- machineconfig/utils/cloud/onedrive/transaction.py +796 -0
- machineconfig/utils/code.py +22 -13
- machineconfig/utils/installer.py +78 -35
- machineconfig/utils/installer_utils/installer_abc.py +7 -6
- machineconfig/utils/installer_utils/installer_class.py +44 -25
- machineconfig/utils/io_save.py +107 -0
- machineconfig/utils/links.py +19 -15
- machineconfig/utils/options.py +4 -8
- machineconfig/utils/path.py +91 -78
- machineconfig/utils/path_reduced.py +608 -0
- machineconfig/utils/procs.py +110 -45
- machineconfig/utils/scheduling.py +312 -222
- machineconfig/utils/utils.py +7 -7
- machineconfig/utils/utils2.py +42 -0
- machineconfig/utils/utils5.py +84 -0
- machineconfig/utils/ve.py +49 -87
- {machineconfig-1.95.dist-info → machineconfig-1.96.dist-info}/METADATA +2 -2
- machineconfig-1.96.dist-info/RECORD +437 -0
- machineconfig/cluster/session_managers.py +0 -183
- machineconfig/cluster/templates/f.py +0 -4
- machineconfig/jobs/python/__pycache__/check_installations.cpython-311.pyc +0 -0
- machineconfig/jobs/python/__pycache__/checkout_version.cpython-311.pyc +0 -0
- machineconfig/jobs/python/__pycache__/python_ve_symlink.cpython-311.pyc +0 -0
- machineconfig/jobs/python/checkout_version.py +0 -123
- machineconfig/jobs/python/vscode/__pycache__/api.cpython-311.pyc +0 -0
- machineconfig/jobs/python/vscode/__pycache__/link_ve.cpython-311.pyc +0 -0
- machineconfig/jobs/python_custom_installers/__pycache__/hx.cpython-311.pyc +0 -0
- machineconfig/jobs/python_windows_installers/__pycache__/__init__.cpython-311.pyc +0 -0
- machineconfig/scripts/python/.mypy_cache/.gitignore +0 -2
- machineconfig/scripts/python/.mypy_cache/3.11/@plugins_snapshot.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/__future__.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/__future__.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/_ast.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/_ast.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/_bz2.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/_bz2.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/_codecs.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/_codecs.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/_collections_abc.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/_collections_abc.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/_compression.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/_compression.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/_decimal.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/_decimal.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/_frozen_importlib.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/_frozen_importlib.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/_frozen_importlib_external.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/_frozen_importlib_external.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/_io.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/_io.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/_locale.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/_locale.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/_stat.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/_stat.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/_struct.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/_struct.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/_thread.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/_thread.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/_typeshed/__init__.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/_typeshed/__init__.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/_typeshed/importlib.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/_typeshed/importlib.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/_warnings.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/_warnings.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/_weakref.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/_weakref.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/_weakrefset.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/_weakrefset.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/abc.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/abc.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/argparse.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/argparse.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/ast.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/ast.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/binascii.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/binascii.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/builtins.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/builtins.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/bz2.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/bz2.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/calendar.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/calendar.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/codecs.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/codecs.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/collections/__init__.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/collections/__init__.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/collections/abc.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/collections/abc.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/configparser.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/configparser.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/contextlib.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/contextlib.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/dataclasses.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/dataclasses.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/datetime.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/datetime.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/decimal.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/decimal.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/dis.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/dis.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/email/__init__.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/email/__init__.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/email/_policybase.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/email/_policybase.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/email/charset.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/email/charset.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/email/contentmanager.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/email/contentmanager.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/email/errors.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/email/errors.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/email/header.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/email/header.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/email/message.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/email/message.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/email/policy.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/email/policy.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/enum.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/enum.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/fnmatch.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/fnmatch.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/functools.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/functools.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/gc.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/gc.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/genericpath.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/genericpath.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/getpass.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/getpass.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/__init__.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/__init__.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/cmd.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/cmd.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/compat.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/compat.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/config.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/config.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/db.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/db.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/diff.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/diff.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/exc.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/exc.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/index/__init__.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/index/__init__.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/index/base.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/index/base.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/index/fun.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/index/fun.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/index/typ.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/index/typ.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/index/util.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/index/util.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/objects/__init__.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/objects/__init__.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/objects/base.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/objects/base.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/objects/blob.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/objects/blob.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/objects/commit.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/objects/commit.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/objects/fun.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/objects/fun.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/objects/submodule/__init__.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/objects/submodule/__init__.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/objects/submodule/base.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/objects/submodule/base.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/objects/submodule/root.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/objects/submodule/root.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/objects/submodule/util.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/objects/submodule/util.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/objects/tag.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/objects/tag.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/objects/tree.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/objects/tree.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/objects/util.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/objects/util.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/refs/__init__.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/refs/__init__.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/refs/head.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/refs/head.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/refs/log.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/refs/log.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/refs/reference.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/refs/reference.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/refs/remote.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/refs/remote.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/refs/symbolic.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/refs/symbolic.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/refs/tag.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/refs/tag.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/remote.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/remote.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/repo/__init__.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/repo/__init__.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/repo/base.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/repo/base.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/repo/fun.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/repo/fun.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/types.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/types.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/util.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/git/util.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/glob.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/glob.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/gzip.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/gzip.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/importlib/__init__.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/importlib/__init__.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/importlib/_abc.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/importlib/_abc.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/importlib/_bootstrap.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/importlib/_bootstrap.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/importlib/_bootstrap_external.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/importlib/_bootstrap_external.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/importlib/abc.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/importlib/abc.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/importlib/machinery.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/importlib/machinery.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/importlib/metadata/__init__.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/importlib/metadata/__init__.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/importlib/metadata/_meta.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/importlib/metadata/_meta.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/importlib/readers.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/importlib/readers.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/importlib/resources/__init__.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/importlib/resources/__init__.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/importlib/resources/_common.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/importlib/resources/_common.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/importlib/resources/abc.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/importlib/resources/abc.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/inspect.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/inspect.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/io.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/io.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/itertools.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/itertools.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/locale.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/locale.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/logging/__init__.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/logging/__init__.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/mimetypes.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/mimetypes.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/mmap.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/mmap.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/numbers.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/numbers.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/opcode.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/opcode.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/os/__init__.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/os/__init__.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/os/path.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/os/path.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/pathlib.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/pathlib.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/platform.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/platform.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/posixpath.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/posixpath.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/re.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/re.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/resource.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/resource.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/shlex.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/shlex.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/shutil.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/shutil.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/signal.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/signal.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/src/__init__.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/src/__init__.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/src/machineconfig/__init__.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/src/machineconfig/__init__.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/src/machineconfig/scripts/__init__.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/src/machineconfig/scripts/__init__.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/src/machineconfig/scripts/python/__init__.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/src/machineconfig/scripts/python/__init__.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/sre_compile.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/sre_compile.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/sre_constants.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/sre_constants.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/sre_parse.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/sre_parse.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/stat.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/stat.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/string.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/string.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/struct.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/struct.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/subprocess.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/subprocess.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/sys/__init__.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/sys/__init__.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/tarfile.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/tarfile.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/tempfile.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/tempfile.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/textwrap.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/textwrap.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/threading.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/threading.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/time.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/time.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/types.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/types.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/typing.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/typing.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/typing_extensions.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/typing_extensions.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/urllib/__init__.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/urllib/__init__.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/urllib/parse.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/urllib/parse.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/uuid.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/uuid.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/warnings.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/warnings.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/weakref.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/weakref.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/zipfile/__init__.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/zipfile/__init__.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/zlib.data.json +0 -1
- machineconfig/scripts/python/.mypy_cache/3.11/zlib.meta.json +0 -1
- machineconfig/scripts/python/.mypy_cache/CACHEDIR.TAG +0 -3
- machineconfig/scripts/python/__pycache__/cloud_repo_sync.cpython-311.pyc +0 -0
- machineconfig/scripts/python/__pycache__/gh_models.cpython-311.pyc +0 -0
- machineconfig/scripts/python/__pycache__/url2md.cpython-311.pyc +0 -0
- machineconfig/scripts/python/__pycache__/viewer.cpython-311.pyc +0 -0
- machineconfig/scripts/python/__pycache__/vscode_api.cpython-311.pyc +0 -0
- machineconfig/settings/__pycache__/__init__.cpython-311.pyc +0 -0
- machineconfig/settings/linters/.ruff_cache/.gitignore +0 -2
- machineconfig/settings/linters/.ruff_cache/CACHEDIR.TAG +0 -1
- machineconfig/settings/shells/ipy/profiles/default/__pycache__/__init__.cpython-311.pyc +0 -0
- machineconfig/settings/shells/ipy/profiles/default/startup/__pycache__/__init__.cpython-311.pyc +0 -0
- machineconfig/settings/shells/ipy/profiles/default/startup/__pycache__/playext.cpython-311.pyc +0 -0
- machineconfig/utils/ve_utils/ve1.py +0 -111
- machineconfig/utils/ve_utils/ve2.py +0 -155
- machineconfig-1.95.dist-info/RECORD +0 -712
- {machineconfig-1.95.dist-info → machineconfig-1.96.dist-info}/WHEEL +0 -0
- {machineconfig-1.95.dist-info → machineconfig-1.96.dist-info}/top_level.txt +0 -0
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -3,8 +3,6 @@
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
# # import sys
|
|
6
|
-
# from crocodile.msc.odds import capture_from_webcam
|
|
7
|
-
# from crocodile.meta import Terminal
|
|
8
6
|
# from rich.console import Console
|
|
9
7
|
# from rich.panel import Panel
|
|
10
8
|
# import pytesseract
|
|
@@ -22,7 +20,7 @@
|
|
|
22
20
|
# # import cv2
|
|
23
21
|
# # img_cv = cv2.imread(r'C:\Users\alex\Downloads\name.jpg')
|
|
24
22
|
|
|
25
|
-
# # sys.path.insert(0,
|
|
23
|
+
# # sys.path.insert(0, PathExtended.home().joinpath("AppData/Local/Tesseract-OCR").str)
|
|
26
24
|
# # import pytesseract
|
|
27
25
|
# # print(pytesseract.image_to_string(img_cv))
|
|
28
26
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Choose a theme for Wezterm
|
|
3
3
|
"""
|
|
4
4
|
|
|
5
|
-
from machineconfig.utils.utils import choose_one_option,
|
|
5
|
+
from machineconfig.utils.utils import choose_one_option, PathExtended
|
|
6
6
|
from typing import Any
|
|
7
7
|
import time
|
|
8
8
|
from rich.panel import Panel
|
|
@@ -51,13 +51,13 @@ def main2():
|
|
|
51
51
|
|
|
52
52
|
def set_theme(theme: str):
|
|
53
53
|
print(f"🔄 Setting WezTerm theme to: {theme}")
|
|
54
|
-
txt_lines =
|
|
54
|
+
txt_lines = PathExtended("~/.config/wezterm/wezterm.lua").expanduser().read_text().splitlines()
|
|
55
55
|
res_lines = []
|
|
56
56
|
for line in txt_lines:
|
|
57
57
|
if 'config.color_scheme = ' in line:
|
|
58
58
|
res_lines.append(f"config.color_scheme = '{theme}'")
|
|
59
59
|
else: res_lines.append(line)
|
|
60
|
-
|
|
60
|
+
PathExtended("~/.config/wezterm/wezterm.lua").expanduser().write_text('\n'.join(res_lines))
|
|
61
61
|
time.sleep(0.1)
|
|
62
62
|
print("💾 Configuration saved")
|
|
63
63
|
|
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
CC
|
|
3
3
|
"""
|
|
4
4
|
|
|
5
|
-
from
|
|
6
|
-
from crocodile.core import Struct
|
|
5
|
+
from machineconfig.utils.path_reduced import P as PathExtended
|
|
7
6
|
from crocodile.meta import RepeatUntilNoException
|
|
8
7
|
import getpass
|
|
9
8
|
import argparse
|
|
@@ -15,6 +14,7 @@ from machineconfig.scripts.python.helpers.cloud_helpers import ArgsDefaults, Arg
|
|
|
15
14
|
from rich.console import Console
|
|
16
15
|
from rich.panel import Panel
|
|
17
16
|
from rich.progress import Progress
|
|
17
|
+
from machineconfig.utils.utils2 import pprint
|
|
18
18
|
|
|
19
19
|
console = Console()
|
|
20
20
|
|
|
@@ -22,7 +22,7 @@ console = Console()
|
|
|
22
22
|
def get_securely_shared_file(url: Optional[str] = None, folder: Optional[str] = None) -> None:
|
|
23
23
|
console.print(Panel("🚀 Secure File Downloader", title="[bold blue]Downloader[/bold blue]", border_style="blue"))
|
|
24
24
|
|
|
25
|
-
folder_obj =
|
|
25
|
+
folder_obj = PathExtended.cwd() if folder is None else PathExtended(folder)
|
|
26
26
|
print(f"📂 Target folder: {folder_obj}")
|
|
27
27
|
|
|
28
28
|
if os.environ.get("DECRYPTION_PASSWORD") is not None:
|
|
@@ -42,14 +42,14 @@ def get_securely_shared_file(url: Optional[str] = None, folder: Optional[str] =
|
|
|
42
42
|
console.print(Panel("📡 Downloading from URL...", title="[bold blue]Download[/bold blue]", border_style="blue"))
|
|
43
43
|
with Progress(transient=True) as progress:
|
|
44
44
|
_task = progress.add_task("Downloading... ", total=None)
|
|
45
|
-
url_obj =
|
|
45
|
+
url_obj = PathExtended(url).download(folder=folder_obj)
|
|
46
46
|
|
|
47
47
|
console.print(Panel(f"📥 Downloaded file: {url_obj}", title="[bold green]Success[/bold green]", border_style="green"))
|
|
48
48
|
|
|
49
49
|
console.print(Panel("🔐 Decrypting and extracting...", title="[bold blue]Processing[/bold blue]", border_style="blue"))
|
|
50
50
|
with Progress(transient=True) as progress:
|
|
51
51
|
_task = progress.add_task("Decrypting... ", total=None)
|
|
52
|
-
tmp_folder =
|
|
52
|
+
tmp_folder = PathExtended.tmpdir(prefix="tmp_unzip")
|
|
53
53
|
try:
|
|
54
54
|
res = url_obj.decrypt(pwd=pwd, inplace=True).unzip(inplace=True, folder=tmp_folder)
|
|
55
55
|
res.search("*").apply(lambda x: x.move(folder=folder_obj, overwrite=True))
|
|
@@ -107,7 +107,7 @@ def arg_parser() -> None:
|
|
|
107
107
|
cloud, source, target = parse_cloud_source_target(args=args_obj, source=source, target=target)
|
|
108
108
|
|
|
109
109
|
console.print(Panel("⚙️ Configuration:", title="[bold blue]Config[/bold blue]", border_style="blue"))
|
|
110
|
-
|
|
110
|
+
pprint(args_obj.__dict__, "CLI config")
|
|
111
111
|
|
|
112
112
|
if args_obj.key is not None:
|
|
113
113
|
console.print(Panel("❌ Key-based encryption is not supported yet", title="[bold red]Error[/bold red]", border_style="red"))
|
|
@@ -116,7 +116,7 @@ def arg_parser() -> None:
|
|
|
116
116
|
if cloud in source:
|
|
117
117
|
console.print(Panel(f"📥 DOWNLOADING FROM CLOUD\n☁️ Cloud: {cloud}\n📂 Source: {source.replace(cloud + ':', '')}\n🎯 Target: {target}", title="[bold blue]Download[/bold blue]", border_style="blue", width=152))
|
|
118
118
|
|
|
119
|
-
|
|
119
|
+
PathExtended(target).from_cloud(cloud=cloud, remotepath=source.replace(cloud + ":", ""),
|
|
120
120
|
unzip=args_obj.zip, decrypt=args_obj.encrypt, pwd=args_obj.pwd,
|
|
121
121
|
overwrite=args_obj.overwrite,
|
|
122
122
|
rel2home=args_obj.rel2home, os_specific=args_obj.os_specific, root=args_obj.root, strict=False,
|
|
@@ -126,7 +126,7 @@ def arg_parser() -> None:
|
|
|
126
126
|
elif cloud in target:
|
|
127
127
|
console.print(Panel(f"📤 UPLOADING TO CLOUD\n☁️ Cloud: {cloud}\n📂 Source: {source}\n🎯 Target: {target.replace(cloud + ':', '')}", title="[bold blue]Upload[/bold blue]", border_style="blue", width=152))
|
|
128
128
|
|
|
129
|
-
res =
|
|
129
|
+
res = PathExtended(source).to_cloud(cloud=cloud, remotepath=target.replace(cloud + ":", ""),
|
|
130
130
|
zip=args_obj.zip, encrypt=args_obj.encrypt, pwd=args_obj.pwd,
|
|
131
131
|
rel2home=args_obj.rel2home, root=args_obj.root, os_specific=args_obj.os_specific, strict=False,
|
|
132
132
|
share=args_obj.share)
|
|
@@ -134,8 +134,8 @@ def arg_parser() -> None:
|
|
|
134
134
|
|
|
135
135
|
if args_obj.share:
|
|
136
136
|
fname = f".share_url_{cloud}"
|
|
137
|
-
if
|
|
138
|
-
else: share_url_path =
|
|
137
|
+
if PathExtended(source).is_dir(): share_url_path = PathExtended(source).joinpath(fname)
|
|
138
|
+
else: share_url_path = PathExtended(source).with_suffix(fname)
|
|
139
139
|
share_url_path.write_text(res.as_url_str())
|
|
140
140
|
console.print(Panel(f"🔗 SHARE URL GENERATED\n📝 URL file: {share_url_path}\n🌍 {res.as_url_str()}", title="[bold blue]Share[/bold blue]", border_style="blue", width=152))
|
|
141
141
|
else:
|
|
@@ -1,99 +1,77 @@
|
|
|
1
|
-
"""Run cloud manager.
|
|
2
|
-
"""
|
|
3
|
-
|
|
4
|
-
# from machineconfig.cluster.
|
|
5
|
-
from
|
|
6
|
-
from rich.
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
cm.rerun_jobs()
|
|
79
|
-
print("✅ Jobs restarted successfully")
|
|
80
|
-
|
|
81
|
-
if args.monitor_cloud:
|
|
82
|
-
title = "👁️ STARTING CLOUD MONITOR"
|
|
83
|
-
console.print(Panel(title, title_align="left", expand=False))
|
|
84
|
-
cm.run_monitor()
|
|
85
|
-
|
|
86
|
-
if args.serve:
|
|
87
|
-
title1 = "🚀 STARTING JOB SERVER"
|
|
88
|
-
run_line = f"💻 Running {args.num_jobs} worker{'s' if args.num_jobs > 1 else ''}"
|
|
89
|
-
cloud_line = f"☁️ Cloud: {args.cloud if args.cloud else 'Default'}"
|
|
90
|
-
console.print(Panel(f"{title1}\n{run_line}\n{cloud_line}", title_align="left", expand=False))
|
|
91
|
-
|
|
92
|
-
title = "✅ Cloud Manager finished successfully"
|
|
93
|
-
console.print(Panel(title, title_align="left", expand=False))
|
|
94
|
-
import sys
|
|
95
|
-
sys.exit(0)
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
if __name__ == '__main__':
|
|
99
|
-
main()
|
|
1
|
+
# """Run cloud manager.
|
|
2
|
+
# """
|
|
3
|
+
|
|
4
|
+
# from machineconfig.cluster.cloud_manager import CloudManager
|
|
5
|
+
# from rich.console import Console # Add import for Console
|
|
6
|
+
# from rich.panel import Panel # Add import for Panel
|
|
7
|
+
# import argparse
|
|
8
|
+
|
|
9
|
+
# console = Console()
|
|
10
|
+
|
|
11
|
+
# BOX_WIDTH = 150 # width for box drawing
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
# def print_section_title(title: str):
|
|
15
|
+
# """Prints a section title formatted nicely with a border and padding."""
|
|
16
|
+
# console = Console()
|
|
17
|
+
# console.print(Panel(title, title_align="left", expand=False))
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
# def main():
|
|
21
|
+
# console = Console() # Add console initialization
|
|
22
|
+
# console.print(Panel("☁️ Cloud Manager", title_align="left", expand=False))
|
|
23
|
+
|
|
24
|
+
# parser = argparse.ArgumentParser()
|
|
25
|
+
# parser.add_argument("-c", "--cloud", help="Rclone Config Name", action="store", type=str, default=None)
|
|
26
|
+
# parser.add_argument("-s", "--serve", help="Start job server", action="store_true", default=False)
|
|
27
|
+
# parser.add_argument("-R", "--reset_local", help="Clear local cache", action="store_true", default=False)
|
|
28
|
+
# parser.add_argument("-r", "--rerun_jobs", help="Re-run jobs by bringing them back from wherever to the queue.", action="store_true", default=False)
|
|
29
|
+
# parser.add_argument("-L", "--release_lock", help="Release lock.", action="store_true", default=False)
|
|
30
|
+
# parser.add_argument("-f", "--queue_failed_jobs", help="Bring failed jobs back to queued jobs for a re-trial.", action="store_true", default=False)
|
|
31
|
+
# parser.add_argument("-m", "--monitor_cloud", help="Monitor workers instead of running a job server.", action="store_true", default=False)
|
|
32
|
+
# parser.add_argument("-j", "--num_jobs", help="Number of jobs the server will run in parallel.", action="store", type=int, default=1)
|
|
33
|
+
# args = parser.parse_args()
|
|
34
|
+
|
|
35
|
+
# init_line = f"🔧 Initializing Cloud Manager with {args.num_jobs} worker{'s' if args.num_jobs > 1 else ''}"
|
|
36
|
+
# console.print(Panel(init_line, title_align="left", expand=False))
|
|
37
|
+
|
|
38
|
+
# cm = CloudManager(max_jobs=args.num_jobs, cloud=args.cloud, reset_local=args.reset_local)
|
|
39
|
+
|
|
40
|
+
# if args.release_lock:
|
|
41
|
+
# line = "🔓 Releasing lock..."
|
|
42
|
+
# console.print(Panel(line, title_align="left", expand=False))
|
|
43
|
+
# cm.claim_lock()
|
|
44
|
+
# cm.release_lock()
|
|
45
|
+
# print("✅ Lock successfully released")
|
|
46
|
+
|
|
47
|
+
# if args.queue_failed_jobs:
|
|
48
|
+
# line = "🔄 Requeuing failed jobs..."
|
|
49
|
+
# console.print(Panel(line, title_align="left", expand=False))
|
|
50
|
+
# cm.clean_failed_jobs_mess()
|
|
51
|
+
# print("✅ Failed jobs moved to queue")
|
|
52
|
+
|
|
53
|
+
# if args.rerun_jobs:
|
|
54
|
+
# line = "🔁 Rerunning jobs..."
|
|
55
|
+
# console.print(Panel(line, title_align="left", expand=False))
|
|
56
|
+
# cm.rerun_jobs()
|
|
57
|
+
# print("✅ Jobs restarted successfully")
|
|
58
|
+
|
|
59
|
+
# if args.monitor_cloud:
|
|
60
|
+
# title = "👁️ STARTING CLOUD MONITOR"
|
|
61
|
+
# console.print(Panel(title, title_align="left", expand=False))
|
|
62
|
+
# cm.run_monitor()
|
|
63
|
+
|
|
64
|
+
# if args.serve:
|
|
65
|
+
# title1 = "🚀 STARTING JOB SERVER"
|
|
66
|
+
# run_line = f"💻 Running {args.num_jobs} worker{'s' if args.num_jobs > 1 else ''}"
|
|
67
|
+
# cloud_line = f"☁️ Cloud: {args.cloud if args.cloud else 'Default'}"
|
|
68
|
+
# console.print(Panel(f"{title1}\n{run_line}\n{cloud_line}", title_align="left", expand=False))
|
|
69
|
+
|
|
70
|
+
# title = "✅ Cloud Manager finished successfully"
|
|
71
|
+
# console.print(Panel(title, title_align="left", expand=False))
|
|
72
|
+
# import sys
|
|
73
|
+
# sys.exit(0)
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
# if __name__ == '__main__':
|
|
77
|
+
# main()
|
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
from machineconfig.utils.utils import PROGRAM_PATH, choose_one_option
|
|
6
|
-
from
|
|
6
|
+
from machineconfig.utils.utils2 import read_ini
|
|
7
|
+
from machineconfig.utils.path_reduced import P as PathExtended
|
|
7
8
|
|
|
8
9
|
import platform
|
|
9
10
|
import argparse
|
|
@@ -18,17 +19,16 @@ DEFAULT_MOUNT = "~/data/rclone"
|
|
|
18
19
|
|
|
19
20
|
|
|
20
21
|
def get_rclone_config():
|
|
21
|
-
if platform.system() == "Windows": config =
|
|
22
|
-
elif platform.system()
|
|
22
|
+
if platform.system() == "Windows": config = read_ini(PathExtended.home().joinpath("AppData/Roaming/rclone/rclone.conf"))
|
|
23
|
+
elif platform.system() in ["Linux", "Darwin"]: config = read_ini(PathExtended.home().joinpath(".config/rclone/rclone.conf"))
|
|
23
24
|
else: raise ValueError("unsupported platform")
|
|
24
25
|
return config
|
|
25
26
|
|
|
26
27
|
|
|
27
28
|
def get_mprocs_mount_txt(cloud: str, rclone_cmd: str, cloud_brand: str): # cloud_brand = config[cloud]["type"]
|
|
28
|
-
# config = Read.ini(P.home().joinpath(".config/rclone/rclone.conf"))
|
|
29
29
|
header = f"{' ' + cloud + ' | ' + cloud_brand + ' '}".center(50, "=")
|
|
30
30
|
if platform.system() == "Windows":
|
|
31
|
-
sub_text_path =
|
|
31
|
+
sub_text_path = PathExtended.tmpfile(suffix=".ps1").write_text(f"""
|
|
32
32
|
echo "{header}"
|
|
33
33
|
iex 'rclone about {cloud}:'
|
|
34
34
|
echo 'See {DEFAULT_MOUNT}/{cloud} for the mounted cloud'
|
|
@@ -59,19 +59,20 @@ def mount(cloud: Optional[str], network: Optional[str], destination: Optional[st
|
|
|
59
59
|
|
|
60
60
|
if network is None:
|
|
61
61
|
if destination is None:
|
|
62
|
-
mount_loc =
|
|
62
|
+
mount_loc = PathExtended(DEFAULT_MOUNT).expanduser().joinpath(cloud)
|
|
63
63
|
else:
|
|
64
|
-
mount_loc =
|
|
64
|
+
mount_loc = PathExtended(destination)
|
|
65
65
|
|
|
66
66
|
mount_info = f"📂 Mount location: {mount_loc}"
|
|
67
67
|
console.print(Panel(mount_info, border_style="blue"))
|
|
68
68
|
|
|
69
69
|
if platform.system() == "Windows":
|
|
70
70
|
print("🪟 Creating mount directory on Windows...")
|
|
71
|
-
mount_loc.parent.
|
|
72
|
-
elif platform.system()
|
|
73
|
-
|
|
74
|
-
|
|
71
|
+
mount_loc.parent.mkdir(parents=True, exist_ok=True)
|
|
72
|
+
elif platform.system() in ["Linux", "Darwin"]:
|
|
73
|
+
system_name = "Linux" if platform.system() == "Linux" else "macOS"
|
|
74
|
+
print(f"🐧 Creating mount directory on {system_name}...")
|
|
75
|
+
try: mount_loc.mkdir(parents=True, exist_ok=True)
|
|
75
76
|
except (FileExistsError, OSError) as err:
|
|
76
77
|
# We need a umount command here.
|
|
77
78
|
warning_line = "⚠️ WARNING: Mount directory issue"
|
|
@@ -94,7 +95,7 @@ def mount(cloud: Optional[str], network: Optional[str], destination: Optional[st
|
|
|
94
95
|
txt = f"""
|
|
95
96
|
wt --window 0 --profile "Windows PowerShell" --startingDirectory "$HOME/data/rclone" `; split-pane --horizontal --profile "Command Prompt" --size 0.2 powershell -Command "{mount_cmd}" `; split-pane --vertical --profile "Windows PowerShell" --size 0.2 powershell -NoExit -Command "rclone about {cloud}:" `; move-focus up
|
|
96
97
|
"""
|
|
97
|
-
elif platform.system()
|
|
98
|
+
elif platform.system() in ["Linux", "Darwin"]: txt = f"""
|
|
98
99
|
|
|
99
100
|
ZJ_SESSIONS=$(zellij list-sessions)
|
|
100
101
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"""utils"""
|
|
2
2
|
|
|
3
3
|
import git
|
|
4
|
-
from
|
|
4
|
+
from machineconfig.utils.path_reduced import P as PathExtended
|
|
5
5
|
from crocodile.meta import Terminal
|
|
6
|
-
from
|
|
6
|
+
from machineconfig.utils.utils2 import randstr, read_ini
|
|
7
7
|
|
|
8
8
|
from machineconfig.scripts.python.helpers.repo_sync_helpers import fetch_dotfiles
|
|
9
9
|
from machineconfig.utils.utils import CONFIG_PATH, DEFAULTS_PATH, PROGRAM_PATH, choose_one_option
|
|
@@ -13,7 +13,7 @@ import argparse
|
|
|
13
13
|
from typing import Optional, Literal
|
|
14
14
|
from rich.console import Console
|
|
15
15
|
from rich.panel import Panel
|
|
16
|
-
from rich.text import Text
|
|
16
|
+
# from rich.text import Text
|
|
17
17
|
|
|
18
18
|
console = Console()
|
|
19
19
|
|
|
@@ -25,18 +25,18 @@ def main(cloud: Optional[str] = None, path: Optional[str] = None, message: Optio
|
|
|
25
25
|
pwd: Optional[str] = None):
|
|
26
26
|
if cloud is None:
|
|
27
27
|
try:
|
|
28
|
-
cloud_resolved =
|
|
28
|
+
cloud_resolved = read_ini(DEFAULTS_PATH)['general']['rclone_config_name']
|
|
29
29
|
console.print(Panel(f"⚠️ Using default cloud: `{cloud_resolved}` from {DEFAULTS_PATH}", title="Default Cloud", border_style="yellow"))
|
|
30
30
|
except FileNotFoundError:
|
|
31
31
|
console.print(Panel(f"❌ ERROR: No cloud profile found\nLocation: {DEFAULTS_PATH}\nPlease set one up or provide one via the --cloud flag.", title="Error", border_style="red"))
|
|
32
32
|
return ""
|
|
33
33
|
else: cloud_resolved = cloud
|
|
34
34
|
|
|
35
|
-
# repo_root =
|
|
36
|
-
repo_local_root =
|
|
35
|
+
# repo_root = PathExtended(args.repo).expanduser().absolute()
|
|
36
|
+
repo_local_root = PathExtended.cwd() if path is None else PathExtended(path).expanduser().absolute()
|
|
37
37
|
repo_local_obj = git.Repo(repo_local_root, search_parent_directories=True)
|
|
38
|
-
repo_local_root =
|
|
39
|
-
CONFIG_PATH.joinpath("remote").
|
|
38
|
+
repo_local_root = PathExtended(repo_local_obj.working_dir) # cwd might have been in a sub directory of repo_root, so its better to redefine it.
|
|
39
|
+
CONFIG_PATH.joinpath("remote").mkdir(parents=True, exist_ok=True)
|
|
40
40
|
repo_remote_root = CONFIG_PATH.joinpath("remote", repo_local_root.rel2home()) # .delete(sure=True)
|
|
41
41
|
|
|
42
42
|
try:
|
|
@@ -82,6 +82,7 @@ git pull originEnc master
|
|
|
82
82
|
from git.remote import Remote
|
|
83
83
|
Remote.remove(repo_local_obj, "originEnc")
|
|
84
84
|
repo_local_root.to_cloud(cloud=cloud_resolved, zip=True, encrypt=True, rel2home=True, pwd=pwd, os_specific=False)
|
|
85
|
+
return "success"
|
|
85
86
|
else:
|
|
86
87
|
console.print(Panel(f"⚠️ MERGE FAILED\n💾 Keeping local copy of remote at:\n📂 {repo_remote_root}", title="Merge Failed", border_style="red"))
|
|
87
88
|
|
|
@@ -89,7 +90,7 @@ git pull originEnc master
|
|
|
89
90
|
option1 = 'Delete remote copy and push local:'
|
|
90
91
|
program_1_py = f"""
|
|
91
92
|
from machineconfig.scripts.python.helpers.repo_sync_helpers import delete_remote_repo_copy_and_push_local as func
|
|
92
|
-
func(remote_repo=r'{repo_remote_root
|
|
93
|
+
func(remote_repo=r'{str(repo_remote_root)}', local_repo=r'{str(repo_local_root)}', cloud=r'{cloud_resolved}')
|
|
93
94
|
"""
|
|
94
95
|
shell_file_1 = get_shell_file_executing_python_script(python_script=program_1_py, ve_name="ve")
|
|
95
96
|
# ================================================================================
|
|
@@ -99,7 +100,7 @@ func(remote_repo=r'{repo_remote_root.to_str()}', local_repo=r'{repo_local_root.t
|
|
|
99
100
|
rm -rfd {repo_local_root}
|
|
100
101
|
mv {repo_remote_root} {repo_local_root}
|
|
101
102
|
"""
|
|
102
|
-
if platform.system()
|
|
103
|
+
if platform.system() in ["Linux", "Darwin"]: program_2 += """
|
|
103
104
|
sudo chmod 600 $HOME/.ssh/*
|
|
104
105
|
sudo chmod 700 $HOME/.ssh
|
|
105
106
|
sudo chmod +x $HOME/dotfiles/scripts/linux -R
|
|
@@ -111,7 +112,7 @@ sudo chmod +x $HOME/dotfiles/scripts/linux -R
|
|
|
111
112
|
option3 = 'Inspect repos:'
|
|
112
113
|
program_3_py = f"""
|
|
113
114
|
from machineconfig.scripts.python.helper.repo_sync_helpers import inspect_repos as func
|
|
114
|
-
func(repo_local_root=r'{repo_local_root
|
|
115
|
+
func(repo_local_root=r'{str(repo_local_root)}', repo_remote_root=r'{str(repo_remote_root)}')
|
|
115
116
|
"""
|
|
116
117
|
shell_file_3 = get_shell_file_executing_python_script(python_script=program_3_py, ve_name="ve")
|
|
117
118
|
# ================================================================================
|
|
@@ -147,6 +148,8 @@ git commit -am "finished merging"
|
|
|
147
148
|
case "overwriteLocal": program_content = program_2
|
|
148
149
|
case "InspectRepos": program_content = shell_file_3.read_text()
|
|
149
150
|
case "RemoveLocalRclone": program_content = program_4
|
|
151
|
+
case _:
|
|
152
|
+
raise ValueError(f"Unknown action: {action}")
|
|
150
153
|
PROGRAM_PATH.write_text(program_content)
|
|
151
154
|
return program_content
|
|
152
155
|
|
|
@@ -3,21 +3,24 @@ croshell
|
|
|
3
3
|
"""
|
|
4
4
|
|
|
5
5
|
import argparse
|
|
6
|
-
from
|
|
7
|
-
from
|
|
6
|
+
from machineconfig.utils.path_reduced import P as PathExtended
|
|
7
|
+
from machineconfig.utils.utils2 import randstr
|
|
8
8
|
from machineconfig.utils.utils import PROGRAM_PATH, display_options
|
|
9
|
-
from machineconfig.utils.
|
|
9
|
+
from machineconfig.utils.ve import get_ve_path_and_ipython_profile, get_ve_activate_line
|
|
10
10
|
from typing import Optional
|
|
11
11
|
from rich.console import Console
|
|
12
12
|
from rich.panel import Panel
|
|
13
13
|
from rich.text import Text # Added import for rich.text
|
|
14
|
+
# from machineconfig.utils.utils2 import pprint
|
|
14
15
|
|
|
15
16
|
console = Console()
|
|
16
17
|
|
|
17
18
|
|
|
18
19
|
def add_print_header_pycode(path: str, title: str):
|
|
19
20
|
return f"""
|
|
20
|
-
|
|
21
|
+
# from machineconfig.utils.path_reduced import P as PathExtended
|
|
22
|
+
from crocodile.file_management import P as PathExtended
|
|
23
|
+
pycode = PathExtended(r'{path}').read_text(encoding="utf-8")
|
|
21
24
|
pycode = pycode.split("except Exception: print(pycode)")[2]
|
|
22
25
|
|
|
23
26
|
try:
|
|
@@ -40,13 +43,13 @@ from rich.panel import Panel
|
|
|
40
43
|
from rich.text import Text
|
|
41
44
|
from rich.console import Console
|
|
42
45
|
console = Console()
|
|
43
|
-
p =
|
|
46
|
+
p = PathExtended(r'{path}').absolute()
|
|
44
47
|
try:
|
|
45
48
|
dat = p.readit()
|
|
46
49
|
if isinstance(dat, dict):
|
|
47
50
|
panel_title = f"📄 File Data: {{p.name}}"
|
|
48
51
|
console.print(Panel(Text(str(dat), justify="left"), title=panel_title, expand=False))
|
|
49
|
-
|
|
52
|
+
pprint(dat, PathExtended.name)
|
|
50
53
|
else:
|
|
51
54
|
panel_title = f"📄 Successfully read the file: {{p.name}}"
|
|
52
55
|
console.print(Panel(Text(str(dat), justify="left"), title=panel_title, expand=False))
|
|
@@ -56,7 +59,7 @@ except Exception as e:
|
|
|
56
59
|
"""
|
|
57
60
|
|
|
58
61
|
|
|
59
|
-
def get_read_pyfile_pycode(path:
|
|
62
|
+
def get_read_pyfile_pycode(path: PathExtended, as_module: bool, cmd: str=""):
|
|
60
63
|
if as_module: pycode = fr"""
|
|
61
64
|
import sys
|
|
62
65
|
sys.path.append(r'{path.parent}')
|
|
@@ -64,7 +67,7 @@ from {path.stem} import *
|
|
|
64
67
|
{cmd}
|
|
65
68
|
"""
|
|
66
69
|
else: pycode = f"""
|
|
67
|
-
__file__ =
|
|
70
|
+
__file__ = PathExtended(r'{path}')
|
|
68
71
|
{path.read_text(encoding="utf-8")}
|
|
69
72
|
"""
|
|
70
73
|
return pycode
|
|
@@ -98,7 +101,7 @@ def build_parser():
|
|
|
98
101
|
interactivity = '' if args.nonInteratctive else '-i'
|
|
99
102
|
interpreter = 'python' if args.python else 'ipython'
|
|
100
103
|
ipython_profile: Optional[str] = args.profile
|
|
101
|
-
file =
|
|
104
|
+
file = PathExtended.cwd() # initialization value, could be modified according to args.
|
|
102
105
|
|
|
103
106
|
if args.cmd != "":
|
|
104
107
|
text = "🖥️ Executing command from CLI argument"
|
|
@@ -109,15 +112,15 @@ def build_parser():
|
|
|
109
112
|
elif args.fzf:
|
|
110
113
|
text = "🔍 Searching for Python files..."
|
|
111
114
|
console.print(Panel(text, title="[bold blue]Info[/bold blue]"))
|
|
112
|
-
options =
|
|
115
|
+
options = PathExtended.cwd().search("*.py", r=True).apply(str).list
|
|
113
116
|
file = display_options(msg="Choose a python file to run", options=options, fzf=True, multi=False, )
|
|
114
117
|
assert isinstance(file, str)
|
|
115
|
-
program =
|
|
116
|
-
text = f"📄 Selected file: {
|
|
118
|
+
program = PathExtended(file).read_text(encoding='utf-8')
|
|
119
|
+
text = f"📄 Selected file: {PathExtended(file).name}"
|
|
117
120
|
console.print(Panel(text, title="[bold blue]Info[/bold blue]"))
|
|
118
121
|
|
|
119
122
|
elif args.file != "":
|
|
120
|
-
file =
|
|
123
|
+
file = PathExtended(args.file.lstrip()).expanduser().absolute()
|
|
121
124
|
program = get_read_pyfile_pycode(file, as_module=args.module, cmd=args.cmd)
|
|
122
125
|
text1 = f"📄 Loading file: {file.name}"
|
|
123
126
|
text2 = f"🔄 Mode: {'Module' if args.module else 'Script'}"
|
|
@@ -136,7 +139,7 @@ streamlit run {py_file_path}
|
|
|
136
139
|
"""
|
|
137
140
|
PROGRAM_PATH.write_text(data=final_program)
|
|
138
141
|
return None
|
|
139
|
-
file =
|
|
142
|
+
file = PathExtended(str(args.read).lstrip()).expanduser().absolute()
|
|
140
143
|
program = get_read_data_pycode(str(file))
|
|
141
144
|
text = f"📄 Reading data from: {file.name}"
|
|
142
145
|
console.print(Panel(text, title="[bold blue]Info[/bold blue]"))
|
|
@@ -157,7 +160,8 @@ print_header()
|
|
|
157
160
|
print_logo(logo="crocodile")
|
|
158
161
|
"""
|
|
159
162
|
|
|
160
|
-
pyfile =
|
|
163
|
+
pyfile = PathExtended.tmp().joinpath(f"tmp_scripts/python/croshell/{randstr()}.py")
|
|
164
|
+
pyfile.parent.mkdir(parents=True, exist_ok=True)
|
|
161
165
|
|
|
162
166
|
if args.read != "": title = "Reading Data"
|
|
163
167
|
elif args.file != "": title = "Running Python File"
|
|
@@ -166,15 +170,14 @@ print_logo(logo="crocodile")
|
|
|
166
170
|
|
|
167
171
|
pyfile.write_text(total_program, encoding='utf-8')
|
|
168
172
|
|
|
169
|
-
|
|
170
|
-
if ipython_profile is None
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
ve_activateion_line = get_ve_activate_line(ve_name=args.ve or ve_profile_suggested, a_path=P.cwd())
|
|
173
|
+
ve_root_from_file, ipython_profile = get_ve_path_and_ipython_profile(PathExtended(file))
|
|
174
|
+
ipython_profile = ipython_profile if ipython_profile is not None else "default"
|
|
175
|
+
# ve_activateion_line = get_ve_activate_line(ve_name=args.ve or ve_profile_suggested, a_path=str(PathExtended.cwd()))
|
|
176
|
+
activate_ve_line = get_ve_activate_line(ve_root=args.ve or ve_root_from_file or "$HOME/venvs/ve")
|
|
174
177
|
final_program = f"""
|
|
175
178
|
#!/bin/bash
|
|
176
179
|
|
|
177
|
-
{
|
|
180
|
+
{activate_ve_line}
|
|
178
181
|
|
|
179
182
|
"""
|
|
180
183
|
if args.jupyter:
|