machineconfig 3.82__py3-none-any.whl → 3.85__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/sessions_managers/zellij_local.py +2 -2
- machineconfig/cluster/sessions_managers/zellij_remote.py +2 -2
- machineconfig/cluster/sessions_managers/zellij_utils/example_usage.py +2 -2
- machineconfig/jobs/python/vscode/api.py +8 -7
- machineconfig/scripts/python/ai/initai.py +1 -11
- machineconfig/scripts/python/ai/scripts/lint_and_type_check.ps1 +115 -0
- machineconfig/scripts/python/ai/scripts/lint_and_type_check.sh +78 -11
- machineconfig/scripts/python/cloud_copy.py +33 -27
- machineconfig/scripts/python/cloud_manager.py +0 -2
- machineconfig/scripts/python/cloud_mount.py +13 -10
- machineconfig/scripts/python/cloud_sync.py +30 -28
- machineconfig/scripts/python/croshell.py +46 -53
- machineconfig/scripts/python/dotfile.py +16 -16
- machineconfig/scripts/python/fire_jobs.py +32 -16
- machineconfig/scripts/python/fire_jobs_args_helper.py +43 -16
- machineconfig/scripts/python/helpers/helpers4.py +0 -2
- machineconfig/scripts/python/scheduler.py +0 -1
- machineconfig/scripts/python/share_terminal.py +41 -0
- machineconfig/scripts/python/start_slidev.py +15 -13
- machineconfig/scripts/python/start_terminals.py +19 -19
- machineconfig/scripts/python/t4.py +16 -0
- machineconfig/scripts/python/wifi_conn.py +16 -14
- machineconfig/scripts/python/wsl_windows_transfer.py +23 -29
- machineconfig/utils/ai/generate_file_checklist.py +17 -17
- {machineconfig-3.82.dist-info → machineconfig-3.85.dist-info}/METADATA +1 -1
- {machineconfig-3.82.dist-info → machineconfig-3.85.dist-info}/RECORD +29 -29
- {machineconfig-3.82.dist-info → machineconfig-3.85.dist-info}/entry_points.txt +5 -5
- machineconfig/cluster/templates/cli_gooey.py +0 -115
- machineconfig/jobs/python/vscode/link_ve.py +0 -63
- machineconfig/jobs/python/vscode/select_interpreter.py +0 -87
- {machineconfig-3.82.dist-info → machineconfig-3.85.dist-info}/WHEEL +0 -0
- {machineconfig-3.82.dist-info → machineconfig-3.85.dist-info}/top_level.txt +0 -0
|
@@ -494,8 +494,8 @@ if __name__ == "__main__":
|
|
|
494
494
|
sample_layout: LayoutConfig = {
|
|
495
495
|
"layoutName": "SampleBots",
|
|
496
496
|
"layoutTabs": [
|
|
497
|
-
{"tabName": "🤖Bot1", "startDir": "~/code/bytesense/bithence", "command": "~/scripts/fire -mO go1.py bot1 --
|
|
498
|
-
{"tabName": "🤖Bot2", "startDir": "~/code/bytesense/bithence", "command": "~/scripts/fire -mO go2.py bot2 --
|
|
497
|
+
{"tabName": "🤖Bot1", "startDir": "~/code/bytesense/bithence", "command": "~/scripts/fire -mO go1.py bot1 -- --create_new_bot=True"},
|
|
498
|
+
{"tabName": "🤖Bot2", "startDir": "~/code/bytesense/bithence", "command": "~/scripts/fire -mO go2.py bot2 -- --create_new_bot=True"},
|
|
499
499
|
{"tabName": "📊Monitor", "startDir": "~", "command": "htop"},
|
|
500
500
|
{"tabName": "📝Logs", "startDir": "/var/log", "command": "tail -f /var/log/app.log"},
|
|
501
501
|
],
|
|
@@ -144,8 +144,8 @@ if __name__ == "__main__":
|
|
|
144
144
|
sample_layout: LayoutConfig = {
|
|
145
145
|
"layoutName": "RemoteBots",
|
|
146
146
|
"layoutTabs": [
|
|
147
|
-
{"tabName": "🤖Bot1", "startDir": "~/code/bytesense/bithence", "command": "~/scripts/fire -mO go1.py bot1 --
|
|
148
|
-
{"tabName": "🤖Bot2", "startDir": "~/code/bytesense/bithence", "command": "~/scripts/fire -mO go2.py bot2 --
|
|
147
|
+
{"tabName": "🤖Bot1", "startDir": "~/code/bytesense/bithence", "command": "~/scripts/fire -mO go1.py bot1 -- --create_new_bot=True"},
|
|
148
|
+
{"tabName": "🤖Bot2", "startDir": "~/code/bytesense/bithence", "command": "~/scripts/fire -mO go2.py bot2 -- --create_new_bot=True"},
|
|
149
149
|
{"tabName": "📊Monitor", "startDir": "~", "command": "htop"},
|
|
150
150
|
{"tabName": "📝Logs", "startDir": "/var/log", "command": "tail -f /var/log/app.log"},
|
|
151
151
|
],
|
|
@@ -17,8 +17,8 @@ def example_usage():
|
|
|
17
17
|
sample_layout: LayoutConfig = {
|
|
18
18
|
"layoutName": "ExampleRemoteSession",
|
|
19
19
|
"layoutTabs": [
|
|
20
|
-
{"tabName": "🤖Bot1", "startDir": "~/code/bytesense/bithence", "command": "~/scripts/fire -mO go1.py bot1 --
|
|
21
|
-
{"tabName": "🤖Bot2", "startDir": "~/code/bytesense/bithence", "command": "~/scripts/fire -mO go2.py bot2 --
|
|
20
|
+
{"tabName": "🤖Bot1", "startDir": "~/code/bytesense/bithence", "command": "~/scripts/fire -mO go1.py bot1 -- --create_new_bot=True"},
|
|
21
|
+
{"tabName": "🤖Bot2", "startDir": "~/code/bytesense/bithence", "command": "~/scripts/fire -mO go2.py bot2 -- --create_new_bot=True"},
|
|
22
22
|
{"tabName": "📊Monitor", "startDir": "~", "command": "htop"},
|
|
23
23
|
{"tabName": "📝Logs", "startDir": "/var/log", "command": "tail -f /var/log/app.log"},
|
|
24
24
|
],
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
from pathlib import Path
|
|
2
2
|
from machineconfig.utils.accessories import randstr
|
|
3
|
+
from typing import Annotated
|
|
4
|
+
import typer
|
|
3
5
|
|
|
4
6
|
|
|
5
7
|
def open_file_in_new_instance(file_path: str):
|
|
@@ -35,14 +37,13 @@ code --profile bitProfile --new-window {file_path}
|
|
|
35
37
|
subprocess.run([str(code_path)], shell=True, check=True)
|
|
36
38
|
|
|
37
39
|
|
|
38
|
-
def main():
|
|
39
|
-
|
|
40
|
+
def main(file_path: Annotated[str, typer.Argument(help="Path to the file to open")]) -> None:
|
|
41
|
+
open_file_in_new_instance(file_path)
|
|
40
42
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
open_file_in_new_instance(args.file_path)
|
|
43
|
+
|
|
44
|
+
def arg_parser() -> None:
|
|
45
|
+
typer.run(main)
|
|
45
46
|
|
|
46
47
|
|
|
47
48
|
if __name__ == "__main__":
|
|
48
|
-
|
|
49
|
+
arg_parser()
|
|
@@ -23,6 +23,7 @@ uv init --python 3.13
|
|
|
23
23
|
uv venv
|
|
24
24
|
uv add --upgrade-package pylint pyright mypy pyrefly ty --dev # linters and type checkers
|
|
25
25
|
uv add --upgrade-package pytest --dev
|
|
26
|
+
# uv add typer --dev
|
|
26
27
|
|
|
27
28
|
"""
|
|
28
29
|
import subprocess
|
|
@@ -49,17 +50,6 @@ uv add --upgrade-package pytest --dev
|
|
|
49
50
|
|
|
50
51
|
|
|
51
52
|
def main() -> None:
|
|
52
|
-
# import argparse
|
|
53
|
-
|
|
54
|
-
# parser = argparse.ArgumentParser(description="Add AI configurations to a Python project.")
|
|
55
|
-
# parser.add_argument(
|
|
56
|
-
# "--repo-root",
|
|
57
|
-
# type=str,
|
|
58
|
-
# default=".",
|
|
59
|
-
# help="Path to the root of the repository. Defaults to the current working directory.",
|
|
60
|
-
# )
|
|
61
|
-
# args = parser.parse_args()
|
|
62
|
-
# repo_root = Path(args.repo_root).resolve()
|
|
63
53
|
repo_root = Path.cwd()
|
|
64
54
|
add_ai_configs(repo_root=repo_root)
|
|
65
55
|
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
# gotch1: make sure we are in the right directory: repo root. Solution: check if .pyproject.toml exists, otherwise stop.
|
|
2
|
+
if (!(Test-Path "./pyproject.toml")) {
|
|
3
|
+
Write-Host "Error: pyproject.toml not found in the current directory. Please run this script from the root of a Python project." -ForegroundColor Red
|
|
4
|
+
exit 1
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
# Color definitions (using ANSI escape sequences for cross-platform compatibility)
|
|
8
|
+
$RED = "`e[0;31m"
|
|
9
|
+
$GREEN = "`e[0;32m"
|
|
10
|
+
$YELLOW = "`e[1;33m"
|
|
11
|
+
$BLUE = "`e[0;34m"
|
|
12
|
+
$PURPLE = "`e[0;35m"
|
|
13
|
+
$CYAN = "`e[0;36m"
|
|
14
|
+
$WHITE = "`e[1;37m"
|
|
15
|
+
$BOLD = "`e[1m"
|
|
16
|
+
$UNDERLINE = "`e[4m"
|
|
17
|
+
$NC = "`e[0m" # No Color
|
|
18
|
+
|
|
19
|
+
# Box drawing functions
|
|
20
|
+
function Draw-Box {
|
|
21
|
+
param([string]$text, [string]$color)
|
|
22
|
+
$width = 60
|
|
23
|
+
$padding = [math]::Floor(($width - $text.Length) / 2)
|
|
24
|
+
$line = "─" * $width
|
|
25
|
+
|
|
26
|
+
Write-Host "${color}┌${line}┐${NC}"
|
|
27
|
+
Write-Host ("${color}│" + (" " * $padding) + $text + (" " * $padding) + "│${NC}")
|
|
28
|
+
Write-Host "${color}└${line}┘${NC}"
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function Draw-Progress {
|
|
32
|
+
param([int]$current, [int]$total, [string]$description)
|
|
33
|
+
Write-Host "${CYAN}┌────────────────────────────────────────────────────────────┐${NC}"
|
|
34
|
+
$padding = 50 - $description.Length - 8
|
|
35
|
+
Write-Host ("${CYAN}│${NC} ${BOLD}${WHITE}Step ${current}/${total}:${NC} ${description}" + (" " * $padding) + "${CYAN}│${NC}")
|
|
36
|
+
Write-Host "${CYAN}└────────────────────────────────────────────────────────────┘${NC}"
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
$TOTAL_STEPS = 7
|
|
40
|
+
$CURRENT_STEP = 0
|
|
41
|
+
|
|
42
|
+
Draw-Box "🚀 LINTING & TYPE CHECKING SUITE 🚀" "${BOLD}${CYAN}"
|
|
43
|
+
Write-Host
|
|
44
|
+
|
|
45
|
+
$CURRENT_STEP++
|
|
46
|
+
Draw-Progress $CURRENT_STEP $TOTAL_STEPS "Environment Setup"
|
|
47
|
+
Write-Host "${BLUE}🔧 Installing and updating development dependencies...${NC}"
|
|
48
|
+
# uv add pylint pyright mypy pyrefly ruff ty --dev # linters and type checkers
|
|
49
|
+
# uv add --dev cleanpy pylint pyright mypy pyrefly --upgrade-package cleanpy pylint pyright mypy pyrefly
|
|
50
|
+
uv add --dev pyright --upgrade-package pyright
|
|
51
|
+
uv add --dev pylint --upgrade-package pylint
|
|
52
|
+
uv add --dev mypy --upgrade-package mypy
|
|
53
|
+
uv add --dev pyrefly --upgrade-package pyrefly
|
|
54
|
+
uv add --dev cleanpy --upgrade-package cleanpy
|
|
55
|
+
|
|
56
|
+
uv add types-requests types-toml types-PyYAML types-pytz types-paramiko types-urllib3 --dev
|
|
57
|
+
uv add types-mysqlclient types-SQLAlchemy --dev
|
|
58
|
+
|
|
59
|
+
Write-Host "${GREEN}✅ Environment setup complete!${NC}"
|
|
60
|
+
Write-Host
|
|
61
|
+
|
|
62
|
+
$CURRENT_STEP++
|
|
63
|
+
Draw-Progress $CURRENT_STEP $TOTAL_STEPS "Code Cleanup"
|
|
64
|
+
Write-Host "${YELLOW}🧹 Cleaning and formatting code...${NC}"
|
|
65
|
+
uv run -m cleanpy .
|
|
66
|
+
uv run -m ruff clean
|
|
67
|
+
# uv run -m ruff format .
|
|
68
|
+
uv run -m ruff check . --fix
|
|
69
|
+
uv run --no-dev --project $HOME/code/machineconfig -m machineconfig.scripts.python.ai.generate_files
|
|
70
|
+
|
|
71
|
+
New-Item -ItemType Directory -Force -Path .linters | Out-Null
|
|
72
|
+
|
|
73
|
+
Write-Host "${GREEN}🧹 Code cleanup complete!${NC}"
|
|
74
|
+
Write-Host
|
|
75
|
+
|
|
76
|
+
Draw-Box "🔍 TYPE CHECKERS & LINTERS 🔍" "${BOLD}${PURPLE}"
|
|
77
|
+
|
|
78
|
+
$CURRENT_STEP++
|
|
79
|
+
Draw-Progress $CURRENT_STEP $TOTAL_STEPS "Pyright Type Checker"
|
|
80
|
+
Write-Host "${BLUE}📋 Analyzing types with Pyright...${NC}"
|
|
81
|
+
Remove-Item ./.linters/pyright_result.md -ErrorAction SilentlyContinue
|
|
82
|
+
uv run pyright . | Out-File -FilePath ./.linters/pyright_result.md
|
|
83
|
+
Write-Host "${GREEN}✅ Results saved to ${UNDERLINE}./.linters/pyright_result.md${NC}"
|
|
84
|
+
|
|
85
|
+
$CURRENT_STEP++
|
|
86
|
+
Draw-Progress $CURRENT_STEP $TOTAL_STEPS "MyPy Type Checker"
|
|
87
|
+
Write-Host "${BLUE}📋 Analyzing types with MyPy...${NC}"
|
|
88
|
+
Remove-Item ./.linters/mypy_result.md -ErrorAction SilentlyContinue
|
|
89
|
+
uv run mypy . | Out-File -FilePath ./.linters/mypy_result.md
|
|
90
|
+
Write-Host "${GREEN}✅ Results saved to ${UNDERLINE}./.linters/mypy_result.md${NC}"
|
|
91
|
+
|
|
92
|
+
$CURRENT_STEP++
|
|
93
|
+
Draw-Progress $CURRENT_STEP $TOTAL_STEPS "Pylint Code Analysis"
|
|
94
|
+
Write-Host "${BLUE}📋 Analyzing code quality with Pylint...${NC}"
|
|
95
|
+
Remove-Item ./.linters/pylint_result.md -ErrorAction SilentlyContinue
|
|
96
|
+
uv run pylint ./src/ | Out-File -FilePath ./.linters/pylint_result.md
|
|
97
|
+
Write-Host "${GREEN}✅ Results saved to ${UNDERLINE}./.linters/pylint_result.md${NC}"
|
|
98
|
+
|
|
99
|
+
$CURRENT_STEP++
|
|
100
|
+
Draw-Progress $CURRENT_STEP $TOTAL_STEPS "Pyrefly Type Checker"
|
|
101
|
+
Write-Host "${BLUE}📋 Analyzing types with Pyrefly...${NC}"
|
|
102
|
+
Remove-Item ./.linters/pyrefly_result.md -ErrorAction SilentlyContinue
|
|
103
|
+
uv run pyrefly check . | Out-File -FilePath ./.linters/pyrefly_result.md
|
|
104
|
+
Write-Host "${GREEN}✅ Results saved to ${UNDERLINE}./.linters/pyrefly_result.md${NC}"
|
|
105
|
+
|
|
106
|
+
$CURRENT_STEP++
|
|
107
|
+
Draw-Progress $CURRENT_STEP $TOTAL_STEPS "Ruff Linter"
|
|
108
|
+
Write-Host "${BLUE}📋 Checking code style with Ruff...${NC}"
|
|
109
|
+
Remove-Item ./.linters/ruff_result.md -ErrorAction SilentlyContinue
|
|
110
|
+
uv run ruff check . | Out-File -FilePath ./.linters/ruff_result.md
|
|
111
|
+
Write-Host "${GREEN}✅ Results saved to ${UNDERLINE}./.linters/ruff_result.md${NC}"
|
|
112
|
+
|
|
113
|
+
Write-Host
|
|
114
|
+
Draw-Box "🎉 ALL CHECKS COMPLETED! 🎉" "${BOLD}${GREEN}"
|
|
115
|
+
Write-Host "${BOLD}${GREEN}📁 Check the ${UNDERLINE}.linters${NC}${BOLD}${GREEN} directory for detailed results.${NC}"
|
|
@@ -5,9 +5,50 @@ if [ ! -f "./pyproject.toml" ]; then
|
|
|
5
5
|
exit 1
|
|
6
6
|
fi
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
# Color definitions
|
|
9
|
+
RED='\033[0;31m'
|
|
10
|
+
GREEN='\033[0;32m'
|
|
11
|
+
YELLOW='\033[1;33m'
|
|
12
|
+
BLUE='\033[0;34m'
|
|
13
|
+
PURPLE='\033[0;35m'
|
|
14
|
+
CYAN='\033[0;36m'
|
|
15
|
+
WHITE='\033[1;37m'
|
|
16
|
+
BOLD='\033[1m'
|
|
17
|
+
UNDERLINE='\033[4m'
|
|
18
|
+
NC='\033[0m' # No Color
|
|
9
19
|
|
|
10
|
-
|
|
20
|
+
# Box drawing functions
|
|
21
|
+
draw_box() {
|
|
22
|
+
local text="$1"
|
|
23
|
+
local color="$2"
|
|
24
|
+
local width=60
|
|
25
|
+
local padding=$(( (width - ${#text}) / 2 ))
|
|
26
|
+
local line=""
|
|
27
|
+
for ((i=0; i<width; i++)); do line="${line}─"; done
|
|
28
|
+
|
|
29
|
+
echo -e "${color}┌${line}┐${NC}"
|
|
30
|
+
printf "${color}│%*s%s%*s│${NC}\n" $padding "" "$text" $padding ""
|
|
31
|
+
echo -e "${color}└${line}┘${NC}"
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
draw_progress() {
|
|
35
|
+
local current="$1"
|
|
36
|
+
local total="$2"
|
|
37
|
+
local description="$3"
|
|
38
|
+
echo -e "${CYAN}┌────────────────────────────────────────────────────────────┐${NC}"
|
|
39
|
+
echo -e "${CYAN}│${NC} ${BOLD}${WHITE}Step ${current}/${total}:${NC} ${description}${CYAN}$(printf '%*s' $((50 - ${#description} - 8)) "")│${NC}"
|
|
40
|
+
echo -e "${CYAN}└────────────────────────────────────────────────────────────┘${NC}"
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
TOTAL_STEPS=7
|
|
44
|
+
CURRENT_STEP=0
|
|
45
|
+
|
|
46
|
+
draw_box "🚀 LINTING & TYPE CHECKING SUITE 🚀" "${BOLD}${CYAN}"
|
|
47
|
+
echo
|
|
48
|
+
|
|
49
|
+
((CURRENT_STEP++))
|
|
50
|
+
draw_progress $CURRENT_STEP $TOTAL_STEPS "Environment Setup"
|
|
51
|
+
echo -e "${BLUE}🔧 Installing and updating development dependencies...${NC}"
|
|
11
52
|
# uv add pylint pyright mypy pyrefly ruff ty --dev # linters and type checkers
|
|
12
53
|
# uv add --dev cleanpy pylint pyright mypy pyrefly --upgrade-package cleanpy pylint pyright mypy pyrefly
|
|
13
54
|
uv add --dev pyright --upgrade-package pyright
|
|
@@ -16,10 +57,15 @@ uv add --dev mypy --upgrade-package mypy
|
|
|
16
57
|
uv add --dev pyrefly --upgrade-package pyrefly
|
|
17
58
|
uv add --dev cleanpy --upgrade-package cleanpy
|
|
18
59
|
|
|
19
|
-
|
|
20
60
|
uv add types-requests types-toml types-PyYAML types-pytz types-paramiko types-urllib3 --dev
|
|
21
61
|
uv add types-mysqlclient types-SQLAlchemy --dev
|
|
22
62
|
|
|
63
|
+
echo -e "${GREEN}✅ Environment setup complete!${NC}"
|
|
64
|
+
echo
|
|
65
|
+
|
|
66
|
+
((CURRENT_STEP++))
|
|
67
|
+
draw_progress $CURRENT_STEP $TOTAL_STEPS "Code Cleanup"
|
|
68
|
+
echo -e "${YELLOW}🧹 Cleaning and formatting code...${NC}"
|
|
23
69
|
uv run -m cleanpy .
|
|
24
70
|
uv run -m ruff clean
|
|
25
71
|
# uv run -m ruff format .
|
|
@@ -28,25 +74,46 @@ uv run --no-dev --project $HOME/code/machineconfig -m machineconfig.scripts.pyth
|
|
|
28
74
|
|
|
29
75
|
mkdir .linters
|
|
30
76
|
|
|
31
|
-
echo "
|
|
77
|
+
echo -e "${GREEN}🧹 Code cleanup complete!${NC}"
|
|
78
|
+
echo
|
|
79
|
+
|
|
80
|
+
draw_box "🔍 TYPE CHECKERS & LINTERS 🔍" "${BOLD}${PURPLE}"
|
|
81
|
+
|
|
82
|
+
((CURRENT_STEP++))
|
|
83
|
+
draw_progress $CURRENT_STEP $TOTAL_STEPS "Pyright Type Checker"
|
|
84
|
+
echo -e "${BLUE}📋 Analyzing types with Pyright...${NC}"
|
|
32
85
|
rm ./.linters/pyright_result.md || true
|
|
33
86
|
uv run pyright . > ./.linters/pyright_result.md
|
|
34
|
-
echo "Results
|
|
87
|
+
echo -e "${GREEN}✅ Results saved to ${UNDERLINE}./.linters/pyright_result.md${NC}"
|
|
35
88
|
|
|
89
|
+
((CURRENT_STEP++))
|
|
90
|
+
draw_progress $CURRENT_STEP $TOTAL_STEPS "MyPy Type Checker"
|
|
91
|
+
echo -e "${BLUE}📋 Analyzing types with MyPy...${NC}"
|
|
36
92
|
rm ./.linters/mypy_result.md || true
|
|
37
93
|
uv run mypy . > ./.linters/mypy_result.md
|
|
38
|
-
echo "Results
|
|
94
|
+
echo -e "${GREEN}✅ Results saved to ${UNDERLINE}./.linters/mypy_result.md${NC}"
|
|
39
95
|
|
|
96
|
+
((CURRENT_STEP++))
|
|
97
|
+
draw_progress $CURRENT_STEP $TOTAL_STEPS "Pylint Code Analysis"
|
|
98
|
+
echo -e "${BLUE}📋 Analyzing code quality with Pylint...${NC}"
|
|
40
99
|
rm ./.linters/pylint_result.md || true
|
|
41
100
|
uv run pylint ./src/ > ./.linters/pylint_result.md
|
|
42
|
-
echo "Results
|
|
101
|
+
echo -e "${GREEN}✅ Results saved to ${UNDERLINE}./.linters/pylint_result.md${NC}"
|
|
43
102
|
|
|
44
|
-
|
|
103
|
+
((CURRENT_STEP++))
|
|
104
|
+
draw_progress $CURRENT_STEP $TOTAL_STEPS "Pyrefly Type Checker"
|
|
105
|
+
echo -e "${BLUE}📋 Analyzing types with Pyrefly...${NC}"
|
|
106
|
+
rm ./.linters/pyrefly_result.md || true
|
|
45
107
|
uv run pyrefly check . > ./.linters/pyrefly_result.md
|
|
46
|
-
echo "Results
|
|
108
|
+
echo -e "${GREEN}✅ Results saved to ${UNDERLINE}./.linters/pyrefly_result.md${NC}"
|
|
47
109
|
|
|
110
|
+
((CURRENT_STEP++))
|
|
111
|
+
draw_progress $CURRENT_STEP $TOTAL_STEPS "Ruff Linter"
|
|
112
|
+
echo -e "${BLUE}📋 Checking code style with Ruff...${NC}"
|
|
48
113
|
rm ./.linters/ruff_result.md || true
|
|
49
114
|
uv run ruff check . > ./.linters/ruff_result.md
|
|
50
|
-
echo "Results
|
|
115
|
+
echo -e "${GREEN}✅ Results saved to ${UNDERLINE}./.linters/ruff_result.md${NC}"
|
|
51
116
|
|
|
52
|
-
echo
|
|
117
|
+
echo
|
|
118
|
+
draw_box "🎉 ALL CHECKS COMPLETED! 🎉" "${BOLD}${GREEN}"
|
|
119
|
+
echo -e "${BOLD}${GREEN}📁 Check the ${UNDERLINE}.linters${NC}${BOLD}${GREEN} directory for detailed results.${NC}"
|
|
@@ -5,9 +5,10 @@ CC
|
|
|
5
5
|
from machineconfig.utils.path_extended import PathExtended as PathExtended
|
|
6
6
|
from tenacity import retry, stop_after_attempt, wait_chain, wait_fixed
|
|
7
7
|
import getpass
|
|
8
|
-
import argparse
|
|
9
8
|
import os
|
|
10
|
-
from typing import Optional
|
|
9
|
+
from typing import Optional, Annotated
|
|
10
|
+
|
|
11
|
+
import typer
|
|
11
12
|
|
|
12
13
|
from machineconfig.scripts.python.helpers.helpers2 import parse_cloud_source_target
|
|
13
14
|
from machineconfig.scripts.python.helpers.cloud_helpers import ArgsDefaults, Args
|
|
@@ -61,33 +62,34 @@ def get_securely_shared_file(url: Optional[str] = None, folder: Optional[str] =
|
|
|
61
62
|
tmp_folder.delete()
|
|
62
63
|
|
|
63
64
|
|
|
64
|
-
def
|
|
65
|
+
def main(
|
|
66
|
+
source: Annotated[str, typer.Argument(help="📂 file/folder path to be taken from here.")],
|
|
67
|
+
target: Annotated[str, typer.Argument(help="🎯 file/folder path to be be sent to here.")],
|
|
68
|
+
overwrite: Annotated[bool, typer.Option(help="✍️ Overwrite existing file.")] = ArgsDefaults.overwrite,
|
|
69
|
+
share: Annotated[bool, typer.Option(help="🔗 Share file / directory")] = ArgsDefaults.share,
|
|
70
|
+
rel2home: Annotated[bool, typer.Option(help="🏠 Relative to `myhome` folder")] = ArgsDefaults.rel2home,
|
|
71
|
+
root: Annotated[Optional[str], typer.Option(help="🌳 Remote root. None is the default, unless rel2home is raied, making the default `myhome`.")] = ArgsDefaults.root,
|
|
72
|
+
key: Annotated[Optional[str], typer.Option(help="🔑 Key for encryption")] = ArgsDefaults.key,
|
|
73
|
+
pwd: Annotated[Optional[str], typer.Option(help="🔒 Password for encryption")] = ArgsDefaults.pwd,
|
|
74
|
+
encrypt: Annotated[bool, typer.Option(help="🔐 Encrypt before sending.")] = ArgsDefaults.encrypt,
|
|
75
|
+
zip_: Annotated[bool, typer.Option("--zip", "-z", help="📦 unzip after receiving.")] = ArgsDefaults.zip_,
|
|
76
|
+
os_specific: Annotated[bool, typer.Option(help="💻 choose path specific for this OS.")] = ArgsDefaults.os_specific,
|
|
77
|
+
config: Annotated[Optional[str], typer.Option(help="⚙️ path to cloud.json file.")] = None,
|
|
78
|
+
) -> None:
|
|
65
79
|
console.print(Panel("☁️ Cloud Copy Utility", title="[bold blue]Cloud Copy[/bold blue]", border_style="blue", width=152))
|
|
66
80
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
parser.add_argument("--pwd", "-p", help="🔒 Password for encryption", type=str, default=ArgsDefaults.pwd)
|
|
80
|
-
parser.add_argument("--encrypt", "-e", help="🔐 Encrypt before sending.", action="store_true", default=ArgsDefaults.encrypt)
|
|
81
|
-
parser.add_argument("--zip", "-z", help="📦 unzip after receiving.", action="store_true", default=ArgsDefaults.zip_)
|
|
82
|
-
parser.add_argument("--os_specific", "-o", help="💻 choose path specific for this OS.", action="store_true", default=ArgsDefaults.os_specific)
|
|
83
|
-
|
|
84
|
-
parser.add_argument("--config", "-c", help="⚙️ path to cloud.json file.", default=None)
|
|
85
|
-
|
|
86
|
-
args = parser.parse_args()
|
|
87
|
-
args_dict = vars(args)
|
|
88
|
-
source: str = args_dict.pop("source")
|
|
89
|
-
target: str = args_dict.pop("target")
|
|
90
|
-
args_obj = Args(**args_dict)
|
|
81
|
+
args_obj = Args(
|
|
82
|
+
overwrite=overwrite,
|
|
83
|
+
share=share,
|
|
84
|
+
rel2home=rel2home,
|
|
85
|
+
root=root,
|
|
86
|
+
key=key,
|
|
87
|
+
pwd=pwd,
|
|
88
|
+
encrypt=encrypt,
|
|
89
|
+
zip=zip_,
|
|
90
|
+
os_specific=os_specific,
|
|
91
|
+
config=config,
|
|
92
|
+
)
|
|
91
93
|
|
|
92
94
|
if args_obj.config == "ss" and (source.startswith("http") or source.startswith("bit.ly")):
|
|
93
95
|
console.print(Panel("🔒 Detected secure share link", title="[bold yellow]Warning[/bold yellow]", border_style="yellow"))
|
|
@@ -153,5 +155,9 @@ def arg_parser() -> None:
|
|
|
153
155
|
raise ValueError(f"Cloud `{cloud}` not found in source or target.")
|
|
154
156
|
|
|
155
157
|
|
|
158
|
+
def arg_parser() -> None:
|
|
159
|
+
typer.run(main)
|
|
160
|
+
|
|
161
|
+
|
|
156
162
|
if __name__ == "__main__":
|
|
157
163
|
arg_parser()
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
# from machineconfig.cluster.cloud_manager import CloudManager
|
|
5
5
|
# from rich.console import Console # Add import for Console
|
|
6
6
|
# from rich.panel import Panel # Add import for Panel
|
|
7
|
-
# import argparse
|
|
8
7
|
|
|
9
8
|
# console = Console()
|
|
10
9
|
|
|
@@ -21,7 +20,6 @@
|
|
|
21
20
|
# console = Console() # Add console initialization
|
|
22
21
|
# console.print(Panel("☁️ Cloud Manager", title_align="left", expand=False))
|
|
23
22
|
|
|
24
|
-
# parser = argparse.ArgumentParser()
|
|
25
23
|
# parser.add_argument("-c", "--cloud", help="Rclone Config Name", action="store", type=str, default=None)
|
|
26
24
|
# parser.add_argument("-s", "--serve", help="Start job server", action="store_true", default=False)
|
|
27
25
|
# parser.add_argument("-R", "--reset_local", help="Clear local cache", action="store_true", default=False)
|
|
@@ -5,8 +5,8 @@ from machineconfig.utils.io import read_ini
|
|
|
5
5
|
from machineconfig.utils.path_extended import PathExtended as PathExtended
|
|
6
6
|
|
|
7
7
|
import platform
|
|
8
|
-
import
|
|
9
|
-
|
|
8
|
+
from typing import Optional, Annotated
|
|
9
|
+
import typer
|
|
10
10
|
from rich.console import Console
|
|
11
11
|
from rich.panel import Panel
|
|
12
12
|
|
|
@@ -153,18 +153,21 @@ zellij action move-focus up
|
|
|
153
153
|
console.print(Panel(f"{title1}\n{title2}", title="Success", border_style="green"))
|
|
154
154
|
|
|
155
155
|
|
|
156
|
-
def main(
|
|
156
|
+
def main(
|
|
157
|
+
cloud: Annotated[Optional[str], typer.Option(help="cloud to mount")] = None,
|
|
158
|
+
destination: Annotated[Optional[str], typer.Option(help="destination to mount")] = None,
|
|
159
|
+
network: Annotated[Optional[str], typer.Option(help="mount network drive")] = None,
|
|
160
|
+
) -> None:
|
|
157
161
|
# draw main title box dynamically
|
|
158
162
|
main_title = "☁️ RCLONE CLOUD MOUNT"
|
|
159
163
|
console.print(Panel(main_title, title_align="left", border_style="blue"))
|
|
160
164
|
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
mount(cloud=args.cloud, network=args.network, destination=args.destination)
|
|
165
|
+
mount(cloud=cloud, network=network, destination=destination)
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
def arg_parser() -> None:
|
|
169
|
+
typer.run(main)
|
|
167
170
|
|
|
168
171
|
|
|
169
172
|
if __name__ == "__main__":
|
|
170
|
-
|
|
173
|
+
arg_parser()
|
|
@@ -6,41 +6,39 @@ from machineconfig.scripts.python.helpers.helpers2 import parse_cloud_source_tar
|
|
|
6
6
|
from machineconfig.scripts.python.helpers.cloud_helpers import Args
|
|
7
7
|
from machineconfig.scripts.python.cloud_mount import get_mprocs_mount_txt
|
|
8
8
|
|
|
9
|
-
import
|
|
9
|
+
from typing import Annotated, Optional
|
|
10
|
+
import typer
|
|
10
11
|
from rich.console import Console
|
|
11
12
|
from rich.panel import Panel
|
|
12
13
|
|
|
13
14
|
console = Console()
|
|
14
15
|
|
|
15
16
|
|
|
16
|
-
def
|
|
17
|
+
def main(
|
|
18
|
+
source: Annotated[str, typer.Argument(help="source")],
|
|
19
|
+
target: Annotated[str, typer.Argument(help="target")],
|
|
20
|
+
transfers: Annotated[int, typer.Option("--transfers", "-t", help="Number of threads in syncing.")] = 10,
|
|
21
|
+
root: Annotated[str, typer.Option("--root", "-R", help="Remote root.")] = "myhome",
|
|
22
|
+
key: Annotated[Optional[str], typer.Option("--key", "-k", help="Key for encryption")] = None,
|
|
23
|
+
pwd: Annotated[Optional[str], typer.Option("--pwd", "-P", help="Password for encryption")] = None,
|
|
24
|
+
encrypt: Annotated[bool, typer.Option("--encrypt", "-e", help="Decrypt after receiving.")] = False,
|
|
25
|
+
zip_: Annotated[bool, typer.Option("--zip", "-z", help="unzip after receiving.")] = False,
|
|
26
|
+
bisync: Annotated[bool, typer.Option("--bisync", "-b", help="Bidirectional sync.")] = False,
|
|
27
|
+
delete: Annotated[bool, typer.Option("--delete", "-D", help="Delete files in remote that are not in local.")] = False,
|
|
28
|
+
verbose: Annotated[bool, typer.Option("--verbose", "-v", help="Verbosity of mprocs to show details of syncing.")] = False,
|
|
29
|
+
) -> None:
|
|
17
30
|
title = "☁️ Cloud Sync Utility"
|
|
18
31
|
console.print(Panel(title, title_align="left", border_style="blue"))
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
parser.add_argument("--delete", "-D", help="Delete files in remote that are not in local.", action="store_true") # default is False
|
|
30
|
-
parser.add_argument("--verbose", "-v", help="Verbosity of mprocs to show details of syncing.", action="store_true") # default is False
|
|
31
|
-
|
|
32
|
-
args = parser.parse_args()
|
|
33
|
-
args_dict = vars(args)
|
|
34
|
-
source: str = args_dict.pop("source")
|
|
35
|
-
target: str = args_dict.pop("target")
|
|
36
|
-
verbose: bool = args_dict.pop("verbose")
|
|
37
|
-
delete: bool = args_dict.pop("delete")
|
|
38
|
-
bisync: bool = args_dict.pop("bisync")
|
|
39
|
-
transfers: int = args_dict.pop("transfers")
|
|
40
|
-
args_obj = Args(**args_dict)
|
|
41
|
-
|
|
42
|
-
args_obj.os_specific = False
|
|
43
|
-
args_obj.rel2home = True
|
|
32
|
+
|
|
33
|
+
args_obj = Args(
|
|
34
|
+
root=root,
|
|
35
|
+
key=key,
|
|
36
|
+
pwd=pwd,
|
|
37
|
+
encrypt=encrypt,
|
|
38
|
+
zip=zip_,
|
|
39
|
+
rel2home=True,
|
|
40
|
+
os_specific=False,
|
|
41
|
+
)
|
|
44
42
|
|
|
45
43
|
cloud, source, target = parse_cloud_source_target(args=args_obj, source=source, target=target)
|
|
46
44
|
# map short flags to long flags (-u -> --upload), for easier use in the script
|
|
@@ -81,5 +79,9 @@ def args_parser():
|
|
|
81
79
|
subprocess.run(txt, shell=True, check=True)
|
|
82
80
|
|
|
83
81
|
|
|
82
|
+
def arg_parser() -> None:
|
|
83
|
+
typer.run(main)
|
|
84
|
+
|
|
85
|
+
|
|
84
86
|
if __name__ == "__main__":
|
|
85
|
-
|
|
87
|
+
arg_parser()
|