machineconfig 1.92__py3-none-any.whl → 1.94__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/__init__.py +0 -8
- machineconfig/cluster/__init__.py +0 -0
- machineconfig/cluster/cloud_manager.py +359 -0
- machineconfig/cluster/data_transfer.py +56 -0
- machineconfig/cluster/distribute.py +280 -0
- machineconfig/cluster/file_manager.py +238 -0
- machineconfig/cluster/job_params.py +148 -0
- machineconfig/cluster/loader_runner.py +150 -0
- machineconfig/cluster/remote_machine.py +281 -0
- machineconfig/cluster/script_execution.py +209 -0
- machineconfig/cluster/script_notify_upon_completion.py +63 -0
- machineconfig/cluster/self_ssh.py +59 -0
- machineconfig/cluster/session_managers.py +183 -0
- machineconfig/cluster/templates/__init__.py +0 -0
- machineconfig/cluster/templates/cli_click.py +104 -0
- machineconfig/cluster/templates/cli_gooey.py +119 -0
- machineconfig/cluster/templates/cli_trogon.py +21 -0
- machineconfig/cluster/templates/f.py +4 -0
- machineconfig/cluster/templates/run_cloud.py +52 -0
- machineconfig/cluster/templates/run_cluster.py +69 -0
- machineconfig/cluster/templates/run_remote.py +67 -0
- machineconfig/cluster/templates/utils.py +37 -0
- machineconfig/jobs/__pycache__/__init__.cpython-311.pyc +0 -0
- machineconfig/jobs/linux/msc/lid.sh +26 -0
- machineconfig/jobs/linux/msc/network.sh +39 -0
- machineconfig/jobs/python/__pycache__/__init__.cpython-311.pyc +0 -0
- 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/archive/python_tools.txt +12 -0
- machineconfig/jobs/python/check_installations.py +26 -11
- machineconfig/jobs/python/checkout_version.py +24 -13
- machineconfig/jobs/python/create_zellij_template.py +4 -4
- machineconfig/jobs/python/python_cargo_build_share.py +13 -4
- machineconfig/jobs/python/python_ve_symlink.py +15 -4
- 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/vscode/api.py +48 -0
- machineconfig/jobs/python/vscode/link_ve.py +64 -0
- machineconfig/jobs/python/vscode/select_interpreter.py +84 -0
- machineconfig/jobs/python/vscode/sync_code.py +60 -0
- machineconfig/jobs/python_custom_installers/__pycache__/__init__.cpython-311.pyc +0 -0
- machineconfig/jobs/python_custom_installers/__pycache__/hx.cpython-311.pyc +0 -0
- machineconfig/jobs/python_custom_installers/archive/ngrok.py +62 -0
- machineconfig/jobs/python_custom_installers/dev/aider.py +37 -0
- machineconfig/jobs/python_custom_installers/dev/alacritty.py +72 -0
- machineconfig/jobs/python_custom_installers/dev/brave.py +67 -0
- machineconfig/jobs/python_custom_installers/dev/bypass_paywall.py +50 -0
- machineconfig/jobs/python_custom_installers/dev/code.py +62 -0
- machineconfig/jobs/python_custom_installers/dev/cursor.py +67 -0
- machineconfig/jobs/python_custom_installers/dev/docker.py +70 -0
- machineconfig/jobs/python_custom_installers/dev/docker_desktop.py +77 -0
- machineconfig/jobs/python_custom_installers/dev/espanso.py +82 -0
- machineconfig/jobs/python_custom_installers/dev/goes.py +59 -0
- machineconfig/jobs/python_custom_installers/dev/lvim.py +76 -0
- machineconfig/jobs/python_custom_installers/dev/nerdfont.py +67 -0
- machineconfig/jobs/python_custom_installers/dev/redis.py +69 -0
- machineconfig/jobs/python_custom_installers/dev/reverse_proxy.md +31 -0
- machineconfig/jobs/python_custom_installers/dev/warp-cli.py +71 -0
- machineconfig/jobs/python_custom_installers/dev/wezterm.py +71 -0
- machineconfig/jobs/python_custom_installers/gh.py +46 -4
- machineconfig/jobs/python_custom_installers/hx.py +103 -18
- machineconfig/jobs/python_custom_installers/scripts/linux/brave.sh +52 -0
- machineconfig/jobs/python_custom_installers/scripts/linux/docker.sh +140 -0
- machineconfig/jobs/python_custom_installers/scripts/linux/docker_start.sh +48 -0
- machineconfig/jobs/python_custom_installers/scripts/linux/edge.sh +47 -0
- machineconfig/jobs/python_custom_installers/scripts/linux/nerdfont.sh +64 -0
- machineconfig/jobs/python_custom_installers/scripts/linux/pgsql.sh +53 -0
- machineconfig/jobs/python_custom_installers/scripts/linux/redis.sh +76 -0
- machineconfig/jobs/python_custom_installers/scripts/linux/timescaledb.sh +91 -0
- machineconfig/jobs/python_custom_installers/scripts/linux/vscode.sh +66 -0
- machineconfig/jobs/python_custom_installers/scripts/linux/warp-cli.sh +77 -0
- machineconfig/jobs/python_custom_installers/scripts/linux/wezterm.sh +43 -0
- machineconfig/jobs/python_generic_installers/__pycache__/__init__.cpython-311.pyc +0 -0
- machineconfig/jobs/python_generic_installers/config.json +267 -0
- machineconfig/jobs/python_generic_installers/dev/config.archive.json +18 -0
- machineconfig/jobs/python_generic_installers/dev/config.json +394 -0
- machineconfig/jobs/python_linux_installers/__pycache__/__init__.cpython-311.pyc +0 -0
- machineconfig/jobs/python_linux_installers/archive/config.json +10 -0
- machineconfig/jobs/python_linux_installers/config.json +74 -0
- machineconfig/jobs/python_linux_installers/dev/config.json +138 -0
- machineconfig/jobs/python_windows_installers/__pycache__/__init__.cpython-311.pyc +0 -0
- machineconfig/jobs/python_windows_installers/archive/file.json +11 -0
- machineconfig/jobs/python_windows_installers/config.json +50 -0
- machineconfig/jobs/python_windows_installers/dev/config.json +3 -0
- machineconfig/jobs/windows/archive/archive_pygraphviz.ps1 +14 -0
- machineconfig/jobs/windows/archive/openssh-server_add_key.ps1 +7 -0
- machineconfig/jobs/windows/archive/openssh-server_copy-ssh-id.ps1 +14 -0
- machineconfig/jobs/windows/start_terminal.ps1 +6 -0
- machineconfig/jobs/windows/startup_file.cmd +2 -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 +47 -13
- machineconfig/profile/create_hardlinks.py +42 -12
- machineconfig/profile/records/generic/shares.toml +5 -0
- machineconfig/profile/records/linux/apps_summary_report.csv +48 -0
- machineconfig/profile/records/linux/apps_summary_report.md +49 -0
- machineconfig/profile/records/windows/apps_summary_report.csv +1 -0
- machineconfig/profile/records/windows/apps_summary_report.md +2 -0
- machineconfig/profile/shell.py +62 -11
- machineconfig/scripts/__pycache__/__init__.cpython-311.pyc +0 -0
- machineconfig/scripts/cloud/init.sh +128 -0
- machineconfig/scripts/linux/activate_ve +87 -0
- machineconfig/scripts/linux/archive/tmate_conn +12 -0
- machineconfig/scripts/linux/archive/tmate_start +12 -0
- machineconfig/scripts/linux/archive/transfer_wsl_win +5 -0
- machineconfig/scripts/linux/checkout_versions +8 -0
- machineconfig/scripts/linux/choose_wezterm_theme +9 -0
- machineconfig/scripts/linux/cloud_copy +9 -0
- machineconfig/scripts/linux/cloud_manager +8 -0
- machineconfig/scripts/linux/cloud_mount +24 -0
- machineconfig/scripts/linux/cloud_repo_sync +22 -0
- machineconfig/scripts/linux/cloud_sync +24 -0
- machineconfig/scripts/linux/croshell +24 -0
- machineconfig/scripts/linux/devops +24 -0
- machineconfig/scripts/linux/fire +46 -0
- machineconfig/scripts/linux/ftpx +8 -0
- machineconfig/scripts/linux/fzf2g +21 -0
- machineconfig/scripts/linux/fzfag +17 -0
- machineconfig/scripts/linux/fzffg +25 -0
- machineconfig/scripts/linux/fzfg +23 -0
- machineconfig/scripts/linux/fzfrga +21 -0
- machineconfig/scripts/linux/gh_models +11 -0
- machineconfig/scripts/linux/kill_process +10 -0
- machineconfig/scripts/linux/mount_drive +128 -0
- machineconfig/scripts/linux/mount_nfs +62 -0
- machineconfig/scripts/linux/mount_nw_drive +72 -0
- machineconfig/scripts/linux/mount_smb +3 -0
- machineconfig/scripts/linux/programs +21 -0
- machineconfig/scripts/linux/repos +24 -0
- machineconfig/scripts/linux/scheduler +8 -0
- machineconfig/scripts/linux/share_cloud.sh +81 -0
- machineconfig/scripts/linux/share_nfs +49 -0
- machineconfig/scripts/linux/share_smb +1 -0
- machineconfig/scripts/linux/skrg +4 -0
- machineconfig/scripts/linux/start_docker +23 -0
- machineconfig/scripts/linux/start_slidev +23 -0
- machineconfig/scripts/linux/start_terminals +12 -0
- machineconfig/scripts/linux/switch_ip +20 -0
- machineconfig/scripts/linux/url2md +10 -0
- machineconfig/scripts/linux/z_ls +104 -0
- machineconfig/scripts/python/.mypy_cache/.gitignore +2 -0
- machineconfig/scripts/python/.mypy_cache/3.11/@plugins_snapshot.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/__future__.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/__future__.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/_ast.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/_ast.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/_bz2.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/_bz2.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/_codecs.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/_codecs.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/_collections_abc.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/_collections_abc.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/_compression.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/_compression.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/_decimal.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/_decimal.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/_frozen_importlib.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/_frozen_importlib.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/_frozen_importlib_external.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/_frozen_importlib_external.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/_io.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/_io.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/_locale.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/_locale.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/_stat.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/_stat.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/_struct.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/_struct.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/_thread.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/_thread.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/_typeshed/__init__.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/_typeshed/__init__.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/_typeshed/importlib.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/_typeshed/importlib.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/_warnings.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/_warnings.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/_weakref.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/_weakref.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/_weakrefset.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/_weakrefset.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/abc.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/abc.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/argparse.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/argparse.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/ast.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/ast.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/binascii.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/binascii.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/builtins.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/builtins.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/bz2.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/bz2.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/calendar.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/calendar.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/codecs.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/codecs.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/collections/__init__.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/collections/__init__.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/collections/abc.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/collections/abc.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/configparser.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/configparser.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/contextlib.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/contextlib.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/dataclasses.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/dataclasses.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/datetime.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/datetime.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/decimal.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/decimal.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/dis.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/dis.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/email/__init__.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/email/__init__.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/email/_policybase.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/email/_policybase.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/email/charset.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/email/charset.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/email/contentmanager.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/email/contentmanager.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/email/errors.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/email/errors.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/email/header.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/email/header.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/email/message.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/email/message.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/email/policy.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/email/policy.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/enum.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/enum.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/fnmatch.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/fnmatch.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/functools.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/functools.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/gc.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/gc.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/genericpath.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/genericpath.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/getpass.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/getpass.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/git/__init__.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/git/__init__.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/git/cmd.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/git/cmd.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/git/compat.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/git/compat.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/git/config.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/git/config.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/git/db.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/git/db.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/git/diff.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/git/diff.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/git/exc.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/git/exc.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/git/index/__init__.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/git/index/__init__.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/git/index/base.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/git/index/base.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/git/index/fun.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/git/index/fun.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/git/index/typ.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/git/index/typ.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/git/index/util.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/git/index/util.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/git/objects/__init__.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/git/objects/__init__.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/git/objects/base.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/git/objects/base.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/git/objects/blob.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/git/objects/blob.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/git/objects/commit.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/git/objects/commit.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/git/objects/fun.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/git/objects/fun.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/git/objects/submodule/__init__.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/git/objects/submodule/__init__.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/git/objects/submodule/base.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/git/objects/submodule/base.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/git/objects/submodule/root.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/git/objects/submodule/root.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/git/objects/submodule/util.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/git/objects/submodule/util.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/git/objects/tag.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/git/objects/tag.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/git/objects/tree.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/git/objects/tree.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/git/objects/util.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/git/objects/util.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/git/refs/__init__.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/git/refs/__init__.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/git/refs/head.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/git/refs/head.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/git/refs/log.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/git/refs/log.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/git/refs/reference.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/git/refs/reference.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/git/refs/remote.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/git/refs/remote.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/git/refs/symbolic.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/git/refs/symbolic.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/git/refs/tag.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/git/refs/tag.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/git/remote.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/git/remote.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/git/repo/__init__.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/git/repo/__init__.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/git/repo/base.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/git/repo/base.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/git/repo/fun.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/git/repo/fun.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/git/types.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/git/types.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/git/util.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/git/util.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/glob.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/glob.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/gzip.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/gzip.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/importlib/__init__.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/importlib/__init__.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/importlib/_abc.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/importlib/_abc.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/importlib/_bootstrap.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/importlib/_bootstrap.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/importlib/_bootstrap_external.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/importlib/_bootstrap_external.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/importlib/abc.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/importlib/abc.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/importlib/machinery.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/importlib/machinery.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/importlib/metadata/__init__.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/importlib/metadata/__init__.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/importlib/metadata/_meta.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/importlib/metadata/_meta.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/importlib/readers.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/importlib/readers.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/importlib/resources/__init__.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/importlib/resources/__init__.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/importlib/resources/_common.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/importlib/resources/_common.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/importlib/resources/abc.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/importlib/resources/abc.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/inspect.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/inspect.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/io.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/io.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/itertools.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/itertools.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/locale.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/locale.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/logging/__init__.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/logging/__init__.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/mimetypes.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/mimetypes.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/mmap.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/mmap.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/numbers.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/numbers.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/opcode.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/opcode.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/os/__init__.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/os/__init__.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/os/path.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/os/path.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/pathlib.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/pathlib.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/platform.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/platform.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/posixpath.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/posixpath.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/re.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/re.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/resource.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/resource.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/shlex.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/shlex.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/shutil.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/shutil.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/signal.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/signal.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/src/__init__.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/src/__init__.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/src/machineconfig/__init__.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/src/machineconfig/__init__.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/src/machineconfig/scripts/__init__.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/src/machineconfig/scripts/__init__.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/src/machineconfig/scripts/python/__init__.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/src/machineconfig/scripts/python/__init__.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/sre_compile.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/sre_compile.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/sre_constants.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/sre_constants.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/sre_parse.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/sre_parse.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/stat.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/stat.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/string.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/string.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/struct.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/struct.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/subprocess.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/subprocess.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/sys/__init__.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/sys/__init__.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/tarfile.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/tarfile.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/tempfile.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/tempfile.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/textwrap.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/textwrap.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/threading.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/threading.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/time.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/time.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/types.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/types.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/typing.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/typing.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/typing_extensions.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/typing_extensions.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/urllib/__init__.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/urllib/__init__.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/urllib/parse.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/urllib/parse.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/uuid.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/uuid.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/warnings.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/warnings.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/weakref.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/weakref.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/zipfile/__init__.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/zipfile/__init__.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/zlib.data.json +1 -0
- machineconfig/scripts/python/.mypy_cache/3.11/zlib.meta.json +1 -0
- machineconfig/scripts/python/.mypy_cache/CACHEDIR.TAG +3 -0
- machineconfig/scripts/python/__pycache__/__init__.cpython-311.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_repo_sync.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_jobs.cpython-311.pyc +0 -0
- machineconfig/scripts/python/__pycache__/gh_models.cpython-311.pyc +0 -0
- machineconfig/scripts/python/__pycache__/repos.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/scripts/python/archive/im2text.py +36 -0
- machineconfig/scripts/python/archive/tmate_conn.py +44 -0
- machineconfig/scripts/python/archive/tmate_start.py +48 -0
- machineconfig/scripts/python/choose_wezterm_theme.py +23 -4
- machineconfig/scripts/python/cloud_copy.py +131 -29
- machineconfig/scripts/python/cloud_manager.py +55 -2
- machineconfig/scripts/python/cloud_mount.py +43 -4
- machineconfig/scripts/python/cloud_repo_sync.py +114 -103
- machineconfig/scripts/python/cloud_sync.py +36 -220
- machineconfig/scripts/python/croshell.py +102 -32
- machineconfig/scripts/python/devops.py +143 -42
- machineconfig/scripts/python/devops_add_identity.py +112 -9
- machineconfig/scripts/python/devops_add_ssh_key.py +170 -15
- machineconfig/scripts/python/devops_backup_retrieve.py +132 -14
- machineconfig/scripts/python/devops_devapps_install.py +33 -11
- machineconfig/scripts/python/devops_update_repos.py +36 -29
- machineconfig/scripts/python/dotfile.py +8 -3
- machineconfig/scripts/python/fire_jobs.py +145 -289
- machineconfig/scripts/python/ftpx.py +76 -18
- machineconfig/scripts/python/get_zellij_cmd.py +14 -0
- machineconfig/scripts/python/gh_models.py +72 -25
- machineconfig/scripts/python/helpers/__init__.py +0 -0
- machineconfig/scripts/python/helpers/__pycache__/__init__.cpython-311.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/cloud_helpers.py +134 -0
- machineconfig/scripts/python/helpers/helpers2.py +149 -0
- machineconfig/scripts/python/helpers/helpers4.py +178 -0
- machineconfig/scripts/python/helpers/helpers5.py +50 -0
- machineconfig/scripts/python/helpers/repo_sync_helpers.py +126 -0
- machineconfig/scripts/python/mount_nfs.py +46 -15
- machineconfig/scripts/python/mount_nw_drive.py +22 -10
- machineconfig/scripts/python/mount_ssh.py +28 -12
- machineconfig/scripts/python/onetimeshare.py +23 -15
- machineconfig/scripts/python/pomodoro.py +38 -24
- machineconfig/scripts/python/repos.py +29 -32
- machineconfig/scripts/python/scheduler.py +19 -18
- machineconfig/scripts/python/snapshot.py +14 -6
- machineconfig/scripts/python/start_slidev.py +24 -32
- machineconfig/scripts/python/start_terminals.py +23 -10
- machineconfig/scripts/python/viewer.py +53 -0
- machineconfig/scripts/python/viewer_template.py +140 -0
- machineconfig/scripts/python/wifi_conn.py +20 -12
- machineconfig/scripts/python/wsl_windows_transfer.py +18 -10
- machineconfig/scripts/windows/activate_ve.ps1 +54 -0
- machineconfig/scripts/windows/archive/gource2vid.ps1 +14 -0
- machineconfig/scripts/windows/archive/im2text.ps1 +27 -0
- machineconfig/scripts/windows/archive/secure_pull.ps1 +46 -0
- machineconfig/scripts/windows/archive/secure_push.ps1 +85 -0
- machineconfig/scripts/windows/archive/tmate_conn.ps1 +7 -0
- machineconfig/scripts/windows/checkout_version.ps1 +6 -0
- machineconfig/scripts/windows/choose_wezterm_theme.ps1 +20 -0
- machineconfig/scripts/windows/cloud_copy.ps1 +17 -0
- machineconfig/scripts/windows/cloud_manager.ps1 +8 -0
- machineconfig/scripts/windows/cloud_mount.ps1 +25 -0
- machineconfig/scripts/windows/cloud_repo_sync.ps1 +8 -0
- machineconfig/scripts/windows/cloud_sync.ps1 +21 -0
- machineconfig/scripts/windows/croshell.ps1 +40 -0
- machineconfig/scripts/windows/devops.ps1 +32 -0
- machineconfig/scripts/windows/dotfile.ps1 +9 -0
- machineconfig/scripts/windows/fire.ps1 +33 -0
- machineconfig/scripts/windows/ftpx.ps1 +5 -0
- machineconfig/scripts/windows/fzfb.ps1 +3 -0
- machineconfig/scripts/windows/fzfg.ps1 +2 -0
- machineconfig/scripts/windows/fzfrga.bat +20 -0
- machineconfig/scripts/windows/gpt.ps1 +23 -0
- machineconfig/scripts/windows/grep.ps1 +2 -0
- machineconfig/scripts/windows/kill_process.ps1 +8 -0
- machineconfig/scripts/windows/mount_nfs.ps1 +44 -0
- machineconfig/scripts/windows/mount_nw.ps1 +9 -0
- machineconfig/scripts/windows/mount_smb.ps1 +2 -0
- machineconfig/scripts/windows/mount_ssh.ps1 +17 -0
- machineconfig/scripts/windows/nano.ps1 +3 -0
- machineconfig/scripts/windows/neofetch.ps1 +2 -0
- machineconfig/scripts/windows/pomodoro.ps1 +8 -0
- machineconfig/scripts/windows/py2exe.ps1 +12 -0
- machineconfig/scripts/windows/reload_path.ps1 +3 -0
- machineconfig/scripts/windows/repos.ps1 +27 -0
- machineconfig/scripts/windows/scheduler.ps1 +6 -0
- machineconfig/scripts/windows/share_cloud.cmd +34 -0
- machineconfig/scripts/windows/share_nfs.ps1 +0 -0
- machineconfig/scripts/windows/share_smb.ps1 +22 -0
- machineconfig/scripts/windows/snapshot.ps1 +5 -0
- machineconfig/scripts/windows/start_slidev.ps1 +21 -0
- machineconfig/scripts/windows/start_terminals.ps1 +22 -0
- machineconfig/scripts/windows/unlock_bitlocker.ps1 +10 -0
- machineconfig/scripts/windows/utils/op_script_delete.ps1 +7 -0
- machineconfig/scripts/windows/wifi_conn.ps1 +7 -0
- machineconfig/scripts/windows/wsl_rdp_windows_port_forwarding.ps1 +46 -0
- machineconfig/scripts/windows/wsl_ssh_windows_port_forwarding.ps1 +76 -0
- machineconfig/scripts/windows/wsl_windows_transfer.ps1 +7 -0
- machineconfig/settings/__pycache__/__init__.cpython-311.pyc +0 -0
- machineconfig/settings/broot/br.sh +51 -0
- machineconfig/settings/broot/brootcd.ps1 +32 -0
- machineconfig/settings/broot/conf.toml +5 -0
- machineconfig/settings/glow/glow.yml +11 -0
- machineconfig/settings/gromit-mpx/gromit-mpx.cfg +34 -0
- machineconfig/settings/helix/config.toml +27 -0
- machineconfig/settings/helix/languages.toml +22 -0
- machineconfig/settings/keras/keras.json +6 -0
- machineconfig/settings/keyboard/espanso/config/default.yml +45 -0
- machineconfig/settings/keyboard/espanso/match/base.yml +57 -0
- machineconfig/settings/keyboard/kanata/kanata.kbd +0 -0
- machineconfig/settings/lf/linux/autocall/delete.sh +0 -0
- machineconfig/settings/lf/linux/autocall/on-cd.sh +0 -0
- machineconfig/settings/lf/linux/autocall/on-quit.sh +0 -0
- machineconfig/settings/lf/linux/autocall/open.sh +0 -0
- machineconfig/settings/lf/linux/autocall/paste.sh +0 -0
- machineconfig/settings/lf/linux/autocall/pre-cd.sh +0 -0
- machineconfig/settings/lf/linux/autocall/rename.sh +0 -0
- machineconfig/settings/lf/linux/colors +196 -0
- machineconfig/settings/lf/linux/exe/cleaner.sh +7 -0
- machineconfig/settings/lf/linux/exe/fzf_nano.sh +16 -0
- machineconfig/settings/lf/linux/exe/leftpane_previewer.sh +5 -0
- machineconfig/settings/lf/linux/exe/lfcd.sh +32 -0
- machineconfig/settings/lf/linux/exe/previewer.sh +37 -0
- machineconfig/settings/lf/linux/exe/previewer_archive.sh +155 -0
- machineconfig/settings/lf/linux/icons +357 -0
- machineconfig/settings/lf/linux/lfrc +226 -0
- machineconfig/settings/lf/windows/autocall/delete.ps1 +0 -0
- machineconfig/settings/lf/windows/autocall/on-cd.ps1 +0 -0
- machineconfig/settings/lf/windows/autocall/on-quit.ps1 +0 -0
- machineconfig/settings/lf/windows/autocall/open.ps1 +0 -0
- machineconfig/settings/lf/windows/autocall/paste.ps1 +0 -0
- machineconfig/settings/lf/windows/autocall/pre-cd.ps1 +0 -0
- machineconfig/settings/lf/windows/autocall/rename.ps1 +0 -0
- machineconfig/settings/lf/windows/cd_tere.ps1 +4 -0
- machineconfig/settings/lf/windows/cd_zoxide.ps1 +4 -0
- machineconfig/settings/lf/windows/cd_zoxide2.ps1 +4 -0
- machineconfig/settings/lf/windows/colors +159 -0
- machineconfig/settings/lf/windows/fzf_edit.ps1 +6 -0
- machineconfig/settings/lf/windows/icons +357 -0
- machineconfig/settings/lf/windows/leftpane_previewer.ps1 +3 -0
- machineconfig/settings/lf/windows/lfcd.ps1 +35 -0
- machineconfig/settings/lf/windows/lfrc +133 -0
- machineconfig/settings/lf/windows/mkdir.ps1 +3 -0
- machineconfig/settings/lf/windows/mkfile.ps1 +3 -0
- machineconfig/settings/lf/windows/previewer.ps1 +7 -0
- machineconfig/settings/lf/windows/tst.ps1 +1 -0
- machineconfig/settings/linters/.flake8 +24 -0
- machineconfig/settings/linters/.mypy.ini +29 -0
- machineconfig/settings/linters/.pylintrc +91 -0
- machineconfig/settings/linters/.ruff.toml +77 -0
- machineconfig/settings/linters/.ruff_cache/.gitignore +2 -0
- machineconfig/settings/linters/.ruff_cache/CACHEDIR.TAG +1 -0
- machineconfig/settings/lvim/linux/config.lua +0 -0
- machineconfig/settings/lvim/windows/archive/config_additional.lua +39 -0
- machineconfig/settings/lvim/windows/lua/user/custom_config.lua +13 -0
- machineconfig/settings/mprocs/windows/mprocs.yaml +55 -0
- machineconfig/settings/mprocs/windows/other +12 -0
- machineconfig/settings/pistol/pistol.conf +8 -0
- machineconfig/settings/presenterm/config.yaml +76 -0
- machineconfig/settings/procs/.procs.toml +142 -0
- machineconfig/settings/pudb/pudb.cfg +25 -0
- machineconfig/settings/rofi/config.rasi +4 -0
- machineconfig/settings/rofi/config_default.rasi +147 -0
- machineconfig/settings/shells/alacritty/alacritty.toml +40 -0
- machineconfig/settings/shells/alacritty/alacritty.yml +0 -0
- machineconfig/settings/shells/bash/.inputrc +3 -0
- machineconfig/settings/shells/bash/init.sh +66 -0
- machineconfig/settings/shells/hyper/.hyper.js +201 -0
- machineconfig/settings/shells/ipy/profiles/default/__init__.py +0 -0
- machineconfig/settings/shells/ipy/profiles/default/__pycache__/__init__.cpython-311.pyc +0 -0
- machineconfig/settings/shells/ipy/profiles/default/startup/__init__.py +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/settings/shells/ipy/profiles/default/startup/playext.py +83 -0
- machineconfig/settings/shells/kitty/kitty.conf +1476 -0
- machineconfig/settings/shells/nushell/config.nu +36 -0
- machineconfig/settings/shells/nushell/env.nu +13 -0
- machineconfig/settings/shells/pwsh/init.ps1 +88 -0
- machineconfig/settings/shells/pwsh/profile.ps1 +0 -0
- machineconfig/settings/shells/starship/starship.toml +58 -0
- machineconfig/settings/shells/vtm/settings.xml +297 -0
- machineconfig/settings/shells/wezterm/wezterm.lua +193 -0
- machineconfig/settings/shells/wt/settings.json +526 -0
- machineconfig/settings/streamlit/config.toml +22 -0
- machineconfig/settings/svim/linux/init.toml +48 -0
- machineconfig/settings/svim/windows/init.toml +48 -0
- machineconfig/settings/tere/terecd.ps1 +8 -0
- machineconfig/settings/tere/terecd.sh +8 -0
- machineconfig/settings/tmux/.tmate.conf +3 -0
- machineconfig/settings/tmux/.tmux.conf +6 -0
- machineconfig/settings/wsl/.wslconfig +35 -0
- machineconfig/settings/yazi/keymap.toml +0 -0
- machineconfig/settings/yazi/theme.toml +0 -0
- machineconfig/settings/yazi/yazi.toml +4 -0
- machineconfig/settings/zed/settings.json +35 -0
- machineconfig/settings/zellij/commands/monitor +9 -0
- machineconfig/settings/zellij/commands/standard_panes +33 -0
- machineconfig/settings/zellij/config.kdl +295 -0
- machineconfig/settings/zellij/config.orig.kdl +295 -0
- machineconfig/settings/zellij/layouts/hist +13 -0
- machineconfig/settings/zellij/layouts/panes.kdl +20 -0
- machineconfig/settings/zellij/layouts/st.kdl +21 -0
- machineconfig/settings/zellij/layouts/st2.kdl +59 -0
- machineconfig/settings/zellij/layouts/stacked_panes.kdl +11 -0
- machineconfig/setup_linux/nix/cli_installation.sh +166 -0
- machineconfig/setup_linux/others/mint_keyboard_shortcuts.sh +30 -0
- machineconfig/setup_linux/others/openssh-server_add_pub_key.sh +60 -0
- machineconfig/setup_linux/web_shortcuts/all.sh +53 -0
- machineconfig/setup_linux/web_shortcuts/ascii_art.sh +100 -0
- machineconfig/setup_linux/web_shortcuts/croshell.sh +66 -0
- machineconfig/setup_linux/web_shortcuts/interactive.sh +241 -0
- machineconfig/setup_linux/web_shortcuts/ssh.sh +64 -0
- machineconfig/setup_linux/web_shortcuts/update_system.sh +55 -0
- machineconfig/setup_windows/others/docker.ps1 +7 -0
- machineconfig/setup_windows/others/obs.ps1 +4 -0
- machineconfig/setup_windows/web_shortcuts/all.ps1 +18 -0
- machineconfig/setup_windows/web_shortcuts/ascii_art.ps1 +36 -0
- machineconfig/setup_windows/web_shortcuts/croshell.ps1 +16 -0
- machineconfig/setup_windows/web_shortcuts/interactive.ps1 +200 -0
- machineconfig/setup_windows/web_shortcuts/ssh.ps1 +11 -0
- machineconfig/setup_windows/wt_and_pwsh/install_fonts.ps1 +27 -0
- machineconfig/setup_windows/wt_and_pwsh/set_pwsh_theme.py +12 -2
- machineconfig/setup_windows/wt_and_pwsh/set_wt_settings.py +45 -9
- machineconfig/utils/ai/__init__.py +0 -0
- machineconfig/utils/ai/browser_user_wrapper.py +51 -0
- machineconfig/utils/ai/generate_file_checklist.py +74 -0
- machineconfig/utils/ai/url2md.py +75 -0
- machineconfig/utils/installer.py +101 -253
- machineconfig/utils/installer_utils/__init__.py +0 -0
- machineconfig/utils/installer_utils/installer_abc.py +100 -0
- machineconfig/utils/installer_utils/installer_class.py +253 -0
- machineconfig/utils/procs.py +69 -16
- machineconfig/utils/scheduling.py +47 -13
- machineconfig/utils/utils.py +39 -371
- machineconfig/utils/utils_code.py +82 -0
- machineconfig/utils/utils_links.py +88 -0
- machineconfig/utils/utils_options.py +163 -0
- machineconfig/utils/utils_path.py +151 -0
- machineconfig/utils/ve.py +37 -225
- machineconfig/utils/ve_utils/ve1.py +111 -0
- machineconfig/utils/ve_utils/ve2.py +142 -0
- {machineconfig-1.92.dist-info → machineconfig-1.94.dist-info}/METADATA +25 -21
- machineconfig-1.94.dist-info/RECORD +710 -0
- {machineconfig-1.92.dist-info → machineconfig-1.94.dist-info}/WHEEL +1 -1
- machineconfig-1.92.dist-info/LICENSE +0 -201
- machineconfig-1.92.dist-info/RECORD +0 -70
- {machineconfig-1.92.dist-info → machineconfig-1.94.dist-info}/top_level.txt +0 -0
machineconfig/utils/utils.py
CHANGED
|
@@ -1,331 +1,37 @@
|
|
|
1
|
-
|
|
2
1
|
"""
|
|
3
2
|
Utils
|
|
4
3
|
"""
|
|
5
4
|
|
|
6
|
-
from crocodile.
|
|
7
|
-
from crocodile.file_management import P, randstr, PLike
|
|
8
|
-
from crocodile.meta import Terminal
|
|
5
|
+
from crocodile.file_management import P
|
|
9
6
|
# import crocodile.environment as env
|
|
10
7
|
import machineconfig
|
|
11
|
-
from
|
|
12
|
-
from
|
|
13
|
-
from
|
|
14
|
-
from
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
8
|
+
from machineconfig.utils.utils_options import check_tool_exists, choose_cloud_interactively, choose_multiple_options, choose_one_option, choose_ssh_host, display_options
|
|
9
|
+
from machineconfig.utils.utils_links import build_links, symlink_copy, symlink_func
|
|
10
|
+
from machineconfig.utils.utils_code import get_shell_script_executing_python_file, get_shell_file_executing_python_script, write_shell_script_to_default_program_path, print_code, PROGRAM_PATH
|
|
11
|
+
from machineconfig.utils.utils_path import sanitize_path, match_file_name
|
|
12
|
+
|
|
13
|
+
# Split into multiple assignments to fix incompatible tuple sizes
|
|
14
|
+
_ = get_shell_script_executing_python_file, get_shell_file_executing_python_script, print_code, PROGRAM_PATH, display_options, write_shell_script_to_default_program_path
|
|
15
|
+
_ = build_links
|
|
16
|
+
_ = symlink_copy
|
|
17
|
+
_ = symlink_func
|
|
18
|
+
_ = check_tool_exists
|
|
19
|
+
_ = choose_cloud_interactively
|
|
20
|
+
_ = choose_multiple_options
|
|
21
|
+
_ = choose_one_option
|
|
22
|
+
_ = choose_ssh_host
|
|
23
|
+
_ = sanitize_path
|
|
24
|
+
_ = match_file_name
|
|
18
25
|
|
|
19
26
|
|
|
20
27
|
LIBRARY_ROOT = P(machineconfig.__file__).resolve().parent # .replace(P.home().to_str().lower(), P.home().str)
|
|
21
28
|
REPO_ROOT = LIBRARY_ROOT.parent.parent
|
|
22
|
-
PROGRAM_PATH = (P.home().joinpath("tmp_results", "shells", "python_return_command") + (".ps1" if platform.system() == "Windows" else ".sh"))
|
|
23
29
|
CONFIG_PATH = P.home().joinpath(".config/machineconfig")
|
|
24
30
|
INSTALL_VERSION_ROOT = CONFIG_PATH.joinpath("cli_tools_installers/versions")
|
|
25
31
|
INSTALL_TMP_DIR = P.home().joinpath("tmp_results", "tmp_installers")
|
|
26
32
|
DEFAULTS_PATH = P.home().joinpath("dotfiles/machineconfig/defaults.ini")
|
|
27
33
|
|
|
28
34
|
|
|
29
|
-
T = TypeVar("T")
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
def choose_cloud_interactively() -> str:
|
|
33
|
-
print("Listing Remotes ... ")
|
|
34
|
-
tmp = Terminal().run("rclone listremotes").op_if_successfull_or_default(strict_returcode=False)
|
|
35
|
-
# consider this: remotes = Read.ini(P.home().joinpath(".config/rclone/rclone.conf")).sections()
|
|
36
|
-
if isinstance(tmp, str):
|
|
37
|
-
remotes: list[str] = L(tmp.splitlines()).apply(lambda x: x.replace(":", "")).list
|
|
38
|
-
|
|
39
|
-
else: raise ValueError(f"Got {tmp} from rclone listremotes")
|
|
40
|
-
if len(remotes) == 0:
|
|
41
|
-
raise RuntimeError("You don't have remotes. Configure your rclone first to get cloud services access.")
|
|
42
|
-
cloud: str=choose_one_option(msg="WHICH CLOUD?", options=list(remotes), default=remotes[0], fzf=True)
|
|
43
|
-
return cloud
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
def sanitize_path(a_path: P) -> P:
|
|
47
|
-
path = P(a_path)
|
|
48
|
-
if path.as_posix().startswith("/home"):
|
|
49
|
-
if platform.system() == "Windows": # path copied from Linux to Windows
|
|
50
|
-
path = P.home().joinpath(*path.parts[3:]) # exlcude /home/username
|
|
51
|
-
assert path.exists(), f"File not found: {path}"
|
|
52
|
-
print(f"\n{'--' * 50}\n🔗 Mapped `{a_path}` ➡️ `{path}`\n{'--' * 50}\n")
|
|
53
|
-
elif platform.system() == "Linux" and P.home().as_posix() not in path.as_posix(): # copied from Linux to Linux with different username
|
|
54
|
-
path = P.home().joinpath(*path.parts[3:]) # exlcude /home/username (three parts: /, home, username)
|
|
55
|
-
assert path.exists(), f"File not found: {path}"
|
|
56
|
-
print(f"\n{'--' * 50}\n🔗 Mapped `{a_path}` ➡️ `{path}`\n{'--' * 50}\n")
|
|
57
|
-
elif path.as_posix().startswith("C:"):
|
|
58
|
-
if platform.system() == "Linux": # path copied from Windows to Linux
|
|
59
|
-
xx = str(a_path).replace("\\", "/")
|
|
60
|
-
path = P.home().joinpath(*P(xx).parts[3:]) # exlcude C:\Users\username
|
|
61
|
-
assert path.exists(), f"File not found: {path}"
|
|
62
|
-
print(f"\n{'--' * 50}\n🔗 Mapped `{a_path}` ➡️ `{path}`\n{'--' * 50}\n")
|
|
63
|
-
elif platform.system() == "Windows" and P.home().as_posix() not in path.as_posix(): # copied from Windows to Windows with different username
|
|
64
|
-
path = P.home().joinpath(*path.parts[2:])
|
|
65
|
-
assert path.exists(), f"File not found: {path}"
|
|
66
|
-
print(f"\n{'--' * 50}\n🔗 Mapped `{a_path}` ➡️ `{path}`\n{'--' * 50}\n")
|
|
67
|
-
return path.expanduser().absolute()
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
def match_file_name(sub_string: str, search_root: Optional[P] = None) -> P:
|
|
71
|
-
"""Look up current directory for file name that matches the passed substring."""
|
|
72
|
-
search_root_obj = search_root if search_root is not None else P.cwd()
|
|
73
|
-
search_root_obj = search_root_obj.absolute()
|
|
74
|
-
print(f"Searching for {sub_string} in {search_root_obj}")
|
|
75
|
-
|
|
76
|
-
search_root_objects = search_root_obj.search("*", not_in=["links", ".venv", ".git", ".idea", ".vscode", "node_modules", "__pycache__"])
|
|
77
|
-
search_results: L[P] = L([a_search_root_obj.search(f"*{sub_string}*", r=True) for a_search_root_obj in search_root_objects]).reduce(lambda x, y: x + y) # type: ignore
|
|
78
|
-
search_results = search_results.filter(lambda x: x.suffix in (".py", ".sh", ".ps1"))
|
|
79
|
-
|
|
80
|
-
if len(search_results) == 1:
|
|
81
|
-
path_obj = search_results.list[0]
|
|
82
|
-
elif len(search_results) > 1:
|
|
83
|
-
msg = "Search results are ambiguous or non-existent, choose manually:"
|
|
84
|
-
print(msg)
|
|
85
|
-
choice = choose_one_option(msg=msg, options=search_results.list, fzf=True)
|
|
86
|
-
path_obj = P(choice)
|
|
87
|
-
else:
|
|
88
|
-
# let's do a final retry with sub_string.small()
|
|
89
|
-
sub_string_small = sub_string.lower()
|
|
90
|
-
if sub_string_small != sub_string:
|
|
91
|
-
print("Retrying with small letters")
|
|
92
|
-
return match_file_name(sub_string=sub_string_small)
|
|
93
|
-
from git.repo import Repo
|
|
94
|
-
from git.exc import InvalidGitRepositoryError
|
|
95
|
-
try:
|
|
96
|
-
repo = Repo(search_root_obj, search_parent_directories=True)
|
|
97
|
-
repo_root_dir = P(repo.working_dir)
|
|
98
|
-
if repo_root_dir != search_root_obj: # may be user is in a subdirectory of the repo root, try with root dir.
|
|
99
|
-
print("Retrying with root repo instea of cwd")
|
|
100
|
-
return match_file_name(sub_string=sub_string, search_root=repo_root_dir)
|
|
101
|
-
else:
|
|
102
|
-
search_root_obj = repo_root_dir
|
|
103
|
-
except InvalidGitRepositoryError:
|
|
104
|
-
pass
|
|
105
|
-
|
|
106
|
-
if check_tool_exists(tool_name="fzf"):
|
|
107
|
-
try:
|
|
108
|
-
print(f"Using fd to searching for `{sub_string}` in `{search_root_obj}` ...")
|
|
109
|
-
fzf_cmd = f"cd '{search_root_obj}'; fd --type f --strip-cwd-prefix | fzf --filter={sub_string}"
|
|
110
|
-
search_res = subprocess.run(fzf_cmd, stdout=subprocess.PIPE, text=True, check=True, shell=True).stdout.split("\n")[:-1]
|
|
111
|
-
except subprocess.CalledProcessError as cpe:
|
|
112
|
-
print(f"Failed at fzf search with {sub_string} in {search_root_obj}.\n{cpe}")
|
|
113
|
-
msg = f"\n{'--' * 50}\n💥 Path {sub_string} does not exist. No search results\n{'--' * 50}\n"
|
|
114
|
-
raise FileNotFoundError(msg) from cpe
|
|
115
|
-
|
|
116
|
-
if len(search_res) == 1: return search_root_obj.joinpath(search_res[0])
|
|
117
|
-
else:
|
|
118
|
-
print("Tring with raw fzf search ...")
|
|
119
|
-
try:
|
|
120
|
-
# res = subprocess.run(f"cd '{search_root_obj}'; fzf --query={sub_string}", check=True, stdout=subprocess.PIPE, text=True, shell=True).stdout.strip()
|
|
121
|
-
res = subprocess.run(f"cd '{search_root_obj}'; fd | fzf --query={sub_string}", check=True, stdout=subprocess.PIPE, text=True, shell=True).stdout.strip()
|
|
122
|
-
except subprocess.CalledProcessError as cpe:
|
|
123
|
-
print(f"Failed at fzf search with {sub_string} in {search_root_obj}. {cpe}")
|
|
124
|
-
msg = f"\n{'--' * 50}\n💥 Path {sub_string} does not exist. No search results\n{'--' * 50}\n"
|
|
125
|
-
raise FileNotFoundError(msg) from cpe
|
|
126
|
-
return search_root_obj.joinpath(res)
|
|
127
|
-
|
|
128
|
-
msg = f"\n{'--' * 50}\n💥 Path {sub_string} does not exist. No search results\n{'--' * 50}\n"
|
|
129
|
-
raise FileNotFoundError(msg)
|
|
130
|
-
print(f"\n{'--' * 50}\n🔗 Matched `{sub_string}` ➡️ `{path_obj}`\n{'--' * 50}\n")
|
|
131
|
-
return path_obj
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
def choose_one_option(options: Iterable[T], header: str="", tail: str="", prompt: str="", msg: str="",
|
|
135
|
-
default: Optional[T] = None, fzf: bool=False, custom_input: bool=False) -> T:
|
|
136
|
-
choice_key = display_options(msg=msg, options=options, header=header, tail=tail, prompt=prompt,
|
|
137
|
-
default=default, fzf=fzf, multi=False, custom_input=custom_input)
|
|
138
|
-
assert not isinstance(choice_key, list)
|
|
139
|
-
return choice_key
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
def choose_multiple_options(options: Iterable[T], header: str="", tail: str="", prompt: str="", msg: str="",
|
|
143
|
-
default: Optional[T] = None, custom_input: bool=False) -> list[T]:
|
|
144
|
-
choice_key = display_options(msg=msg, options=options, header=header, tail=tail, prompt=prompt,
|
|
145
|
-
default=default, fzf=True, multi=True,
|
|
146
|
-
custom_input=custom_input)
|
|
147
|
-
if isinstance(choice_key, list): return choice_key
|
|
148
|
-
return [choice_key]
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
def display_options(msg: str, options: Iterable[T], header: str="", tail: str="", prompt: str="",
|
|
152
|
-
default: Optional[T] = None, fzf: bool=False, multi: bool=False, custom_input: bool=False) -> Union[T, list[T]]:
|
|
153
|
-
# TODO: replace with https://github.com/tmbo/questionary
|
|
154
|
-
# # also see https://github.com/charmbracelet/gum
|
|
155
|
-
tool_name = "fzf"
|
|
156
|
-
options_strings: list[str] = [str(x) for x in options]
|
|
157
|
-
default_string = str(default) if default is not None else None
|
|
158
|
-
if fzf and check_tool_exists(tool_name):
|
|
159
|
-
from pyfzf.pyfzf import FzfPrompt
|
|
160
|
-
fzf_prompt = FzfPrompt()
|
|
161
|
-
nl = "\n"
|
|
162
|
-
choice_string_multi: list[str] = fzf_prompt.prompt(choices=options_strings, fzf_options=("--multi" if multi else "") + f' --prompt "{prompt.replace(nl, " ")}" ') # --border-label={msg.replace(nl, ' ')}")
|
|
163
|
-
# --border=rounded doens't work on older versions of fzf installed at Ubuntu 20.04
|
|
164
|
-
if not multi:
|
|
165
|
-
try:
|
|
166
|
-
choice_one_string = choice_string_multi[0]
|
|
167
|
-
choice_idx = options_strings.index(choice_one_string)
|
|
168
|
-
return list(options)[choice_idx]
|
|
169
|
-
except IndexError as ie:
|
|
170
|
-
print(f"{options=}, {choice_string_multi=}")
|
|
171
|
-
print(choice_string_multi)
|
|
172
|
-
raise ie
|
|
173
|
-
choice_idx_s = [options_strings.index(x) for x in choice_string_multi]
|
|
174
|
-
return [list(options)[x] for x in choice_idx_s]
|
|
175
|
-
else:
|
|
176
|
-
console = Console()
|
|
177
|
-
if default is not None:
|
|
178
|
-
assert default in options, f"Default `{default}` option not in options `{list(options)}`"
|
|
179
|
-
default_msg = Text(" <<<<-------- DEFAULT", style="bold red")
|
|
180
|
-
else: default_msg = Text("")
|
|
181
|
-
txt = Text("\n" + msg + "\n")
|
|
182
|
-
for idx, key in enumerate(options):
|
|
183
|
-
txt = txt + Text(f"{idx:2d} ", style="bold blue") + str(key) + (default_msg if default is not None and default == key else "") + "\n"
|
|
184
|
-
txt_panel = Panel(txt, title=header, subtitle=tail, border_style="bold red")
|
|
185
|
-
console.print(txt_panel)
|
|
186
|
-
if default is not None:
|
|
187
|
-
choice_string = input(f"{prompt}\nEnter option number or hit enter for default choice: ")
|
|
188
|
-
else: choice_string = input(f"{prompt}\nEnter option number: ")
|
|
189
|
-
|
|
190
|
-
if choice_string == "":
|
|
191
|
-
if default_string is None:
|
|
192
|
-
print("Default option not available!")
|
|
193
|
-
return display_options(msg=msg, options=options, header=header, tail=tail, prompt=prompt, default=default, fzf=fzf, multi=multi, custom_input=custom_input)
|
|
194
|
-
choice_idx = options_strings.index(default_string)
|
|
195
|
-
assert default is not None, "🧨 Default option not available!"
|
|
196
|
-
choice_one: T = default
|
|
197
|
-
else:
|
|
198
|
-
try:
|
|
199
|
-
choice_idx = int(choice_string, base=10)
|
|
200
|
-
choice_one = list(options)[choice_idx]
|
|
201
|
-
except IndexError as ie: # i.e. converting to integer was successful but indexing failed.
|
|
202
|
-
if choice_string in options_strings: # string input
|
|
203
|
-
choice_idx = options_strings.index(choice_one) # type: ignore #TODO: fix this
|
|
204
|
-
choice_one = list(options)[choice_idx]
|
|
205
|
-
elif custom_input: return str(choice_string) # type: ignore #TODO: fix this
|
|
206
|
-
else: raise ValueError(f"Unknown choice. {choice_string}") from ie
|
|
207
|
-
except TypeError as te: # int(choice_string) failed due to # either the number is invalid, or the input is custom.
|
|
208
|
-
if choice_string in options_strings: # string input
|
|
209
|
-
choice_idx = options_strings.index(choice_one) # type: ignore #TODO: fix this
|
|
210
|
-
choice_one = list(options)[choice_idx]
|
|
211
|
-
elif custom_input:
|
|
212
|
-
return choice_string # type: ignore #TODO: fix this
|
|
213
|
-
else: raise ValueError(f"Unknown choice. {choice_string}") from te
|
|
214
|
-
print(f"{choice_idx}: {choice_one}", "<<<<-------- CHOICE MADE")
|
|
215
|
-
if multi: return [choice_one]
|
|
216
|
-
return choice_one
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
def symlink_func(this: P, to_this: P, prioritize_to_this: bool=True):
|
|
220
|
-
"""helper function. creates a symlink from `this` to `to_this`.
|
|
221
|
-
What can go wrong?
|
|
222
|
-
depending on this and to_this existence, one will be prioretized depending on overwrite value.
|
|
223
|
-
True means this will potentially be overwritten (depending on whether to_this exists or not)
|
|
224
|
-
False means to_this will potentially be overwittten."""
|
|
225
|
-
this = P(this).expanduser().absolute()
|
|
226
|
-
to_this = P(to_this).expanduser().absolute()
|
|
227
|
-
if this.is_symlink(): this.delete(sure=True) # delete if it exists as symblic link, not a concrete path.
|
|
228
|
-
if this.exists(): # this is a problem. It will be resolved via `overwrite`
|
|
229
|
-
if prioritize_to_this is True: # it *can* be deleted, but let's look at target first.
|
|
230
|
-
if to_this.exists(): # this exists, to_this as well. to_this is prioritized.
|
|
231
|
-
this.append(f".orig_{randstr()}", inplace=True) # rename is better than deletion
|
|
232
|
-
else: this.move(path=to_this) # this exists, to_this doesn't. to_this is prioritized.
|
|
233
|
-
elif prioritize_to_this is False: # don't sacrefice this, sacrefice to_this.
|
|
234
|
-
if to_this.exists(): this.move(path=to_this, overwrite=True) # this exists, to_this as well, this is prioritized. # now we are readly to make the link
|
|
235
|
-
else: this.move(path=to_this) # this exists, to_this doesn't, this is prioritized.
|
|
236
|
-
else: # this doesn't exist.
|
|
237
|
-
if not to_this.exists(): to_this.touch() # we have to touch it (file) or create it (folder)
|
|
238
|
-
try:
|
|
239
|
-
# print(f"Linking {this} ➡️ {to_this}")
|
|
240
|
-
P(this).symlink_to(target=to_this, verbose=True, overwrite=True)
|
|
241
|
-
except Exception as ex: print(f"Failed at linking {this} ➡️ {to_this}.\nReason: {ex}")
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
def symlink_copy(this: P, to_this: P, prioritize_to_this: bool=True):
|
|
245
|
-
this = P(this).expanduser().absolute()
|
|
246
|
-
to_this = P(to_this).expanduser().absolute()
|
|
247
|
-
if this.is_symlink(): this.delete(sure=True) # delete if it exists as symblic link, not a concrete path.
|
|
248
|
-
if this.exists(): # this is a problem. It will be resolved via `overwrite`
|
|
249
|
-
if prioritize_to_this is True: # it *can* be deleted, but let's look at target first.
|
|
250
|
-
if to_this.exists(): # this exists, to_this as well. to_this is prioritized.
|
|
251
|
-
this.append(f".orig_{randstr()}", inplace=True) # rename is better than deletion
|
|
252
|
-
else: this.move(path=to_this) # this exists, to_this doesn't. to_this is prioritized.
|
|
253
|
-
elif prioritize_to_this is False: # don't sacrefice this, sacrefice to_this.
|
|
254
|
-
if to_this.exists(): this.move(path=to_this, overwrite=True) # this exists, to_this as well, this is prioritized. # now we are readly to make the link
|
|
255
|
-
else: this.move(path=to_this) # this exists, to_this doesn't, this is prioritized.
|
|
256
|
-
else: # this doesn't exist.
|
|
257
|
-
if not to_this.exists(): to_this.touch() # we have to touch it (file) or create it (folder)
|
|
258
|
-
try:
|
|
259
|
-
to_this.copy(path=this, overwrite=True, verbose=True)
|
|
260
|
-
except Exception as ex: print(f"Failed at linking {this} ➡️ {to_this}.\nReason: {ex}")
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
def get_shell_script_executing_python_file(python_file: str, func: Optional[str] = None, ve_name: str="ve", strict_execution: bool=True):
|
|
264
|
-
if func is None: exec_line = f"""python {python_file}"""
|
|
265
|
-
else: exec_line = f"""python -m fire {python_file} {func}"""
|
|
266
|
-
shell_script = f"""
|
|
267
|
-
. $HOME/scripts/activate_ve {ve_name}
|
|
268
|
-
echo "Executing {exec_line}"
|
|
269
|
-
{exec_line}
|
|
270
|
-
deactivate || true
|
|
271
|
-
"""
|
|
272
|
-
|
|
273
|
-
if strict_execution:
|
|
274
|
-
if platform.system() == "Windows": shell_script = """$ErrorActionPreference = "Stop" """ + "\n" + shell_script
|
|
275
|
-
if platform.system() == "Linux": shell_script = "set -e" + "\n" + shell_script
|
|
276
|
-
|
|
277
|
-
if platform.system() == "Linux": shell_script = "#!/bin/bash" + "\n" + shell_script # vs #!/usr/bin/env bash
|
|
278
|
-
return shell_script
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
def get_shell_script(shell_script: str):
|
|
282
|
-
if platform.system() == "Linux": suffix = ".sh"
|
|
283
|
-
elif platform.system() == "Windows": suffix = ".ps1"
|
|
284
|
-
else: raise NotImplementedError(f"Platform {platform.system()} not implemented.")
|
|
285
|
-
shell_file = P.tmp().joinpath("tmp_scripts", "shell", randstr() + suffix).create(parents_only=True).write_text(shell_script)
|
|
286
|
-
return shell_file
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
def get_shell_file_executing_python_script(python_script: str, ve_name: str, verbose: bool=True):
|
|
290
|
-
if verbose:
|
|
291
|
-
python_script = f"""
|
|
292
|
-
code = r'''{python_script}'''
|
|
293
|
-
try:
|
|
294
|
-
from machineconfig.utils.utils import print_code
|
|
295
|
-
print_code(code=code, lexer="python", desc="Python Script")
|
|
296
|
-
except ImportError: print(code)
|
|
297
|
-
""" + python_script
|
|
298
|
-
python_file = P.tmp().joinpath("tmp_scripts", "python", randstr() + ".py").create(parents_only=True).write_text(python_script)
|
|
299
|
-
shell_script = get_shell_script_executing_python_file(python_file=python_file.to_str(), ve_name=ve_name)
|
|
300
|
-
shell_file = get_shell_script(shell_script)
|
|
301
|
-
return shell_file
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
# def write_shell_script(program: str, desc: str="", preserve_cwd: bool=True, display: bool=True, execute: bool=False):
|
|
305
|
-
def write_shell_script(program: str, desc: str, preserve_cwd: bool, display: bool, execute: bool):
|
|
306
|
-
if preserve_cwd:
|
|
307
|
-
if platform.system() == "Windows":
|
|
308
|
-
program = "$orig_path = $pwd\n" + program + "\ncd $orig_path"
|
|
309
|
-
else:
|
|
310
|
-
program = 'orig_path=$(cd -- "." && pwd)\n' + program + '\ncd "$orig_path" || exit'
|
|
311
|
-
if display:
|
|
312
|
-
print(f"Executing {PROGRAM_PATH}")
|
|
313
|
-
print_code(code=program, lexer="shell", desc=desc)
|
|
314
|
-
PROGRAM_PATH.create(parents_only=True).write_text(program)
|
|
315
|
-
if execute:
|
|
316
|
-
Terminal().run(f". {PROGRAM_PATH}", shell="powershell").print_if_unsuccessful(desc="Executing shell script", strict_err=True, strict_returncode=True)
|
|
317
|
-
return None
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
def print_code(code: str, lexer: str, desc: str):
|
|
321
|
-
if lexer == "shell":
|
|
322
|
-
if platform.system() == "Windows": lexer = "powershell"
|
|
323
|
-
elif platform.system() == "Linux": lexer = "sh"
|
|
324
|
-
else: raise NotImplementedError(f"lexer {lexer} not implemented for system {platform.system()}")
|
|
325
|
-
console = Console()
|
|
326
|
-
console.print(Panel(Syntax(code=code, lexer=lexer), title=desc), style="bold red")
|
|
327
|
-
|
|
328
|
-
|
|
329
35
|
# def get_latest_version(url: str) -> None:
|
|
330
36
|
# # not yet used, consider, using it.
|
|
331
37
|
# import requests
|
|
@@ -336,37 +42,10 @@ def print_code(code: str, lexer: str, desc: str):
|
|
|
336
42
|
# if response.status_code == 200:
|
|
337
43
|
# data = json.loads(response.text)
|
|
338
44
|
# latest_version = data["tag_name"]
|
|
339
|
-
# print("Latest release
|
|
340
|
-
# else: print("
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
def check_tool_exists(tool_name: str, install_script: Optional[str] = None) -> bool:
|
|
344
|
-
"""This is the CLI equivalent of `install_n_import` function of crocodile. """
|
|
345
|
-
if platform.system() == "Windows":
|
|
346
|
-
tool_name = tool_name.replace(".exe", "") + ".exe"
|
|
347
|
-
|
|
348
|
-
if platform.system() == "Windows": cmd = "where.exe"
|
|
349
|
-
elif platform.system() == "Linux": cmd = "which"
|
|
350
|
-
else: raise NotImplementedError(f"platform {platform.system()} not implemented")
|
|
351
|
-
|
|
352
|
-
try:
|
|
353
|
-
_tmp = subprocess.check_output([cmd, tool_name], stderr=subprocess.DEVNULL)
|
|
354
|
-
res: bool=True
|
|
355
|
-
except (subprocess.CalledProcessError, FileNotFoundError):
|
|
356
|
-
res = False
|
|
357
|
-
if res is False and install_script is not None:
|
|
358
|
-
print(f"Installing {tool_name} ...")
|
|
359
|
-
Terminal().run(install_script, shell="powershell").print()
|
|
360
|
-
return check_tool_exists(tool_name=tool_name, install_script=None)
|
|
361
|
-
return res
|
|
45
|
+
# print(f"\n📦 VERSION INFO | Latest release: {latest_version}\n")
|
|
46
|
+
# else: print(f"\n❌ ERROR | API request failed: {response.status_code}\n")
|
|
362
47
|
|
|
363
48
|
|
|
364
|
-
def get_ssh_hosts() -> list[str]:
|
|
365
|
-
from paramiko import SSHConfig
|
|
366
|
-
c = SSHConfig()
|
|
367
|
-
c.parse(open(P.home().joinpath(".ssh/config").to_str(), encoding="utf-8"))
|
|
368
|
-
return list(c.get_hostnames())
|
|
369
|
-
def choose_ssh_host(multi: bool=True): return display_options(msg="", options=get_ssh_hosts(), multi=multi, fzf=True)
|
|
370
49
|
|
|
371
50
|
|
|
372
51
|
def check_dotfiles_version_is_beyond(commit_dtm: str, update: bool=False):
|
|
@@ -379,37 +58,15 @@ def check_dotfiles_version_is_beyond(commit_dtm: str, update: bool=False):
|
|
|
379
58
|
dtm = datetime(dtm.year, dtm.month, dtm.day, dtm.hour, dtm.minute, dtm.second)
|
|
380
59
|
res = dtm > datetime.fromisoformat(commit_dtm)
|
|
381
60
|
if res is False and update is True:
|
|
382
|
-
print(f"
|
|
61
|
+
print(f"""
|
|
62
|
+
{'=' * 60}
|
|
63
|
+
🔄 UPDATE REQUIRED | Updating dotfiles because {dtm} < {datetime.fromisoformat(commit_dtm)}
|
|
64
|
+
{'=' * 60}
|
|
65
|
+
""")
|
|
383
66
|
from machineconfig.scripts.python.cloud_repo_sync import main
|
|
384
67
|
main(cloud=None, path=dotfiles_path)
|
|
385
68
|
return res
|
|
386
69
|
|
|
387
|
-
|
|
388
|
-
def build_links(target_paths: list[tuple[PLike, str]], repo_root: PLike):
|
|
389
|
-
"""Build symboic links from various relevant paths (e.g. data) to `repo_root/links/<name>` to facilitate easy access from
|
|
390
|
-
tree explorer of the IDE.
|
|
391
|
-
"""
|
|
392
|
-
target_dirs_filtered: list[tuple[P, str]] = []
|
|
393
|
-
for a_dir, a_name in target_paths:
|
|
394
|
-
a_dir_obj = P(a_dir).resolve()
|
|
395
|
-
if not a_dir_obj.exists():
|
|
396
|
-
a_dir_obj.mkdir(parents=True, exist_ok=True)
|
|
397
|
-
target_dirs_filtered.append((a_dir_obj, a_name))
|
|
398
|
-
|
|
399
|
-
import git
|
|
400
|
-
repo = git.Repo(repo_root, search_parent_directories=True)
|
|
401
|
-
root_maybe = repo.working_tree_dir
|
|
402
|
-
assert root_maybe is not None
|
|
403
|
-
repo_root_obj = P(root_maybe)
|
|
404
|
-
tmp_results_root = P.home().joinpath("tmp_results", "tmp_data", repo_root_obj.name)
|
|
405
|
-
tmp_results_root.mkdir(parents=True, exist_ok=True)
|
|
406
|
-
target_dirs_filtered.append((tmp_results_root, "tmp_results"))
|
|
407
|
-
|
|
408
|
-
for a_target_path, a_name in target_dirs_filtered:
|
|
409
|
-
links_path = repo_root_obj.joinpath("links", a_name)
|
|
410
|
-
links_path.symlink_to(target=a_target_path)
|
|
411
|
-
|
|
412
|
-
|
|
413
70
|
def wait_for_jobs_to_finish(root: P, pattern: str, wait_for_n_jobs: int, max_wait_minutes: float) -> bool:
|
|
414
71
|
wait_finished: bool=False
|
|
415
72
|
import time
|
|
@@ -419,16 +76,27 @@ def wait_for_jobs_to_finish(root: P, pattern: str, wait_for_n_jobs: int, max_wai
|
|
|
419
76
|
counter = len(parts)
|
|
420
77
|
if counter == wait_for_n_jobs:
|
|
421
78
|
wait_finished = True
|
|
422
|
-
print(f"
|
|
79
|
+
print(f"""
|
|
80
|
+
{'=' * 60}
|
|
81
|
+
✅ JOB COMPLETE | {counter} Jobs finished successfully. Exiting.
|
|
82
|
+
{'=' * 60}
|
|
83
|
+
""")
|
|
423
84
|
return True
|
|
424
85
|
if (time.time() - t0) > 60 * max_wait_minutes:
|
|
425
|
-
print(f"
|
|
86
|
+
print(f"""
|
|
87
|
+
{'=' * 60}
|
|
88
|
+
⏱️ TIMEOUT | Waited for {max_wait_minutes} minutes. Exiting.
|
|
89
|
+
{'=' * 60}
|
|
90
|
+
""")
|
|
426
91
|
return False
|
|
427
|
-
print(f"
|
|
92
|
+
print(f"""
|
|
93
|
+
⏳ PROGRESS | {counter}/{wait_for_n_jobs} jobs finished. Waiting for {wait_for_n_jobs - counter} more jobs to complete, sleeping for 60 seconds.
|
|
94
|
+
""")
|
|
428
95
|
time.sleep(60)
|
|
429
96
|
return False
|
|
430
97
|
|
|
431
98
|
|
|
99
|
+
|
|
432
100
|
if __name__ == '__main__':
|
|
433
101
|
# import typer
|
|
434
102
|
# typer.run(check_tool_exists)
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
from typing import Optional
|
|
2
|
+
import platform
|
|
3
|
+
from rich.console import Console
|
|
4
|
+
from rich.panel import Panel
|
|
5
|
+
from rich.syntax import Syntax
|
|
6
|
+
from crocodile.core import randstr
|
|
7
|
+
from crocodile.file_management import P
|
|
8
|
+
from crocodile.meta import Terminal
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
PROGRAM_PATH = (P.home().joinpath("tmp_results", "shells", "python_return_command") + (".ps1" if platform.system() == "Windows" else ".sh"))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def get_shell_script_executing_python_file(python_file: str, func: Optional[str] = None, ve_name: str="ve", strict_execution: bool=True):
|
|
15
|
+
if func is None: exec_line = f"""python {python_file}"""
|
|
16
|
+
else: exec_line = f"""python -m fire {python_file} {func}"""
|
|
17
|
+
shell_script = f"""
|
|
18
|
+
. $HOME/scripts/activate_ve {ve_name}
|
|
19
|
+
echo "Executing {exec_line}"
|
|
20
|
+
{exec_line}
|
|
21
|
+
deactivate || true
|
|
22
|
+
"""
|
|
23
|
+
|
|
24
|
+
if strict_execution:
|
|
25
|
+
if platform.system() == "Windows": shell_script = """$ErrorActionPreference = "Stop" """ + "\n" + shell_script
|
|
26
|
+
if platform.system() == "Linux": shell_script = "set -e" + "\n" + shell_script
|
|
27
|
+
|
|
28
|
+
if platform.system() == "Linux": shell_script = "#!/bin/bash" + "\n" + shell_script # vs #!/usr/bin/env bash
|
|
29
|
+
return shell_script
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def write_shell_script_to_file(shell_script: str):
|
|
33
|
+
if platform.system() == "Linux": suffix = ".sh"
|
|
34
|
+
elif platform.system() == "Windows": suffix = ".ps1"
|
|
35
|
+
else: raise NotImplementedError(f"Platform {platform.system()} not implemented.")
|
|
36
|
+
shell_file = P.tmp().joinpath("tmp_scripts", "shell", randstr() + suffix).create(parents_only=True).write_text(shell_script)
|
|
37
|
+
return shell_file
|
|
38
|
+
|
|
39
|
+
# Enhanced print/log/error/exception statements for better clarity and consistency
|
|
40
|
+
# Improved formatting and language of messages
|
|
41
|
+
# Ensured consistent use of f-strings with triple quotes where applicable
|
|
42
|
+
|
|
43
|
+
def write_shell_script_to_default_program_path(program: str, desc: str, preserve_cwd: bool, display: bool, execute: bool):
|
|
44
|
+
if preserve_cwd:
|
|
45
|
+
if platform.system() == "Windows":
|
|
46
|
+
program = "$orig_path = $pwd\n" + program + "\ncd $orig_path"
|
|
47
|
+
else:
|
|
48
|
+
program = 'orig_path=$(cd -- "." && pwd)\n' + program + '\ncd "$orig_path" || exit'
|
|
49
|
+
if display:
|
|
50
|
+
print(f"""
|
|
51
|
+
{'=' * 60}
|
|
52
|
+
⚙️ SHELL SCRIPT | Executing at {PROGRAM_PATH}
|
|
53
|
+
{'=' * 60}
|
|
54
|
+
""")
|
|
55
|
+
print_code(code=program, lexer="shell", desc=desc)
|
|
56
|
+
PROGRAM_PATH.create(parents_only=True).write_text(program)
|
|
57
|
+
if execute:
|
|
58
|
+
Terminal().run(f". {PROGRAM_PATH}", shell="powershell").capture().print_if_unsuccessful(desc="🛠️ EXECUTION | Shell script running", strict_err=True, strict_returncode=True)
|
|
59
|
+
return None
|
|
60
|
+
|
|
61
|
+
def get_shell_file_executing_python_script(python_script: str, ve_name: str, verbose: bool=True):
|
|
62
|
+
if verbose:
|
|
63
|
+
python_script = f"""
|
|
64
|
+
code = r'''{python_script}'''
|
|
65
|
+
try:
|
|
66
|
+
from machineconfig.utils.utils import print_code
|
|
67
|
+
print_code(code=code, lexer="python", desc="Python Script")
|
|
68
|
+
except ImportError: print(f"\\n{'=' * 60}\\n📜 PYTHON SCRIPT:\\n\\n{{code}}\\n{'=' * 60}\\n")
|
|
69
|
+
""" + python_script
|
|
70
|
+
python_file = P.tmp().joinpath("tmp_scripts", "python", randstr() + ".py").create(parents_only=True).write_text(python_script)
|
|
71
|
+
shell_script = get_shell_script_executing_python_file(python_file=python_file.to_str(), ve_name=ve_name)
|
|
72
|
+
shell_file = write_shell_script_to_file(shell_script)
|
|
73
|
+
return shell_file
|
|
74
|
+
|
|
75
|
+
def print_code(code: str, lexer: str, desc: str):
|
|
76
|
+
if lexer == "shell":
|
|
77
|
+
if platform.system() == "Windows": lexer = "powershell"
|
|
78
|
+
elif platform.system() == "Linux": lexer = "sh"
|
|
79
|
+
else: raise NotImplementedError(f"Platform {platform.system()} not supported for lexer {lexer}")
|
|
80
|
+
console = Console()
|
|
81
|
+
console.print(Panel(Syntax(code=code, lexer=lexer), title=f"📄 {desc}"), style="bold red")
|
|
82
|
+
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
from crocodile.file_management import P, PLike
|
|
2
|
+
from crocodile.core_modules.core_1 import randstr
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
def build_links(target_paths: list[tuple[PLike, str]], repo_root: PLike):
|
|
6
|
+
"""Build symboic links from various relevant paths (e.g. data) to `repo_root/links/<name>` to facilitate easy access from
|
|
7
|
+
tree explorer of the IDE.
|
|
8
|
+
"""
|
|
9
|
+
target_dirs_filtered: list[tuple[P, str]] = []
|
|
10
|
+
for a_dir, a_name in target_paths:
|
|
11
|
+
a_dir_obj = P(a_dir).resolve()
|
|
12
|
+
if not a_dir_obj.exists():
|
|
13
|
+
a_dir_obj.mkdir(parents=True, exist_ok=True)
|
|
14
|
+
target_dirs_filtered.append((a_dir_obj, a_name))
|
|
15
|
+
|
|
16
|
+
import git
|
|
17
|
+
repo = git.Repo(repo_root, search_parent_directories=True)
|
|
18
|
+
root_maybe = repo.working_tree_dir
|
|
19
|
+
assert root_maybe is not None
|
|
20
|
+
repo_root_obj = P(root_maybe)
|
|
21
|
+
tmp_results_root = P.home().joinpath("tmp_results", "tmp_data", repo_root_obj.name)
|
|
22
|
+
tmp_results_root.mkdir(parents=True, exist_ok=True)
|
|
23
|
+
target_dirs_filtered.append((tmp_results_root, "tmp_results"))
|
|
24
|
+
|
|
25
|
+
for a_target_path, a_name in target_dirs_filtered:
|
|
26
|
+
links_path = repo_root_obj.joinpath("links", a_name)
|
|
27
|
+
links_path.symlink_to(target=a_target_path)
|
|
28
|
+
|
|
29
|
+
def symlink_func(this: P, to_this: P, prioritize_to_this: bool=True):
|
|
30
|
+
"""helper function. creates a symlink from `this` to `to_this`.
|
|
31
|
+
What can go wrong?
|
|
32
|
+
depending on this and to_this existence, one will be prioretized depending on overwrite value.
|
|
33
|
+
True means this will potentially be overwritten (depending on whether to_this exists or not)
|
|
34
|
+
False means to_this will potentially be overwittten."""
|
|
35
|
+
this = P(this).expanduser().absolute()
|
|
36
|
+
to_this = P(to_this).expanduser().absolute()
|
|
37
|
+
if this.is_symlink(): this.delete(sure=True) # delete if it exists as symblic link, not a concrete path.
|
|
38
|
+
if this.exists(): # this is a problem. It will be resolved via `overwrite`
|
|
39
|
+
if prioritize_to_this is True: # it *can* be deleted, but let's look at target first.
|
|
40
|
+
if to_this.exists(): # this exists, to_this as well. to_this is prioritized.
|
|
41
|
+
this.append(f".orig_{randstr()}", inplace=True) # rename is better than deletion
|
|
42
|
+
else: this.move(path=to_this) # this exists, to_this doesn't. to_this is prioritized.
|
|
43
|
+
elif prioritize_to_this is False: # don't sacrefice this, sacrefice to_this.
|
|
44
|
+
if to_this.exists(): this.move(path=to_this, overwrite=True) # this exists, to_this as well, this is prioritized. # now we are readly to make the link
|
|
45
|
+
else: this.move(path=to_this) # this exists, to_this doesn't, this is prioritized.
|
|
46
|
+
else: # this doesn't exist.
|
|
47
|
+
if not to_this.exists(): to_this.touch() # we have to touch it (file) or create it (folder)
|
|
48
|
+
try:
|
|
49
|
+
print(f"""
|
|
50
|
+
{'=' * 60}
|
|
51
|
+
🔗 LINKING | Creating symlink from {this} ➡️ {to_this}
|
|
52
|
+
{'=' * 60}
|
|
53
|
+
""")
|
|
54
|
+
P(this).symlink_to(target=to_this, verbose=True, overwrite=True)
|
|
55
|
+
except Exception as ex:
|
|
56
|
+
print(f"""
|
|
57
|
+
❌ ERROR | Failed at linking {this} ➡️ {to_this}.
|
|
58
|
+
Reason: {ex}
|
|
59
|
+
{'=' * 60}
|
|
60
|
+
""")
|
|
61
|
+
|
|
62
|
+
def symlink_copy(this: P, to_this: P, prioritize_to_this: bool=True):
|
|
63
|
+
this = P(this).expanduser().absolute()
|
|
64
|
+
to_this = P(to_this).expanduser().absolute()
|
|
65
|
+
if this.is_symlink(): this.delete(sure=True) # delete if it exists as symblic link, not a concrete path.
|
|
66
|
+
if this.exists(): # this is a problem. It will be resolved via `overwrite`
|
|
67
|
+
if prioritize_to_this is True: # it *can* be deleted, but let's look at target first.
|
|
68
|
+
if to_this.exists(): # this exists, to_this as well. to_this is prioritized.
|
|
69
|
+
this.append(f".orig_{randstr()}", inplace=True) # rename is better than deletion
|
|
70
|
+
else: this.move(path=to_this) # this exists, to_this doesn't. to_this is prioritized.
|
|
71
|
+
elif prioritize_to_this is False: # don't sacrefice this, sacrefice to_this.
|
|
72
|
+
if to_this.exists(): this.move(path=to_this, overwrite=True) # this exists, to_this as well, this is prioritized. # now we are readly to make the link
|
|
73
|
+
else: this.move(path=to_this) # this exists, to_this doesn't, this is prioritized.
|
|
74
|
+
else: # this doesn't exist.
|
|
75
|
+
if not to_this.exists(): to_this.touch() # we have to touch it (file) or create it (folder)
|
|
76
|
+
try:
|
|
77
|
+
print(f"""
|
|
78
|
+
{'=' * 60}
|
|
79
|
+
📋 COPYING | Copying {to_this} to {this}
|
|
80
|
+
{'=' * 60}
|
|
81
|
+
""")
|
|
82
|
+
to_this.copy(path=this, overwrite=True, verbose=True)
|
|
83
|
+
except Exception as ex:
|
|
84
|
+
print(f"""
|
|
85
|
+
❌ ERROR | Failed at copying {to_this} to {this}.
|
|
86
|
+
Reason: {ex}
|
|
87
|
+
{'=' * 60}
|
|
88
|
+
""")
|