style(cli): replace emojis and unicode symbols with standard brackets [+], [-], [*], [!]

This commit is contained in:
2026-09-14 14:41:09 +03:30
parent 32645108d6
commit 66e2770184
4 changed files with 24 additions and 23 deletions

View File

@@ -174,4 +174,4 @@ CSRF_TRUSTED_ORIGINS = ['https://yourdomain.com']
MIT License — see [LICENSE](LICENSE) for details. MIT License — see [LICENSE](LICENSE) for details.
**Prepared with ❤️ by [MohammadAmin Baranzehi](https://amin.baranzehi.com)** **Prepared by [MohammadAmin Baranzehi](https://amin.baranzehi.com)**

16
cli.py
View File

@@ -47,27 +47,27 @@ CYAN = "\033[96m"
def info(msg: str) -> None: def info(msg: str) -> None:
print(f" {CYAN}→{RESET} {msg}") print(f" {CYAN}[*]{RESET} {msg}")
def success(msg: str) -> None: def success(msg: str) -> None:
print(f" {GREEN}✔{RESET} {msg}") print(f" {GREEN}[+]{RESET} {msg}")
def warn(msg: str) -> None: def warn(msg: str) -> None:
print(f" {YELLOW}⚠{RESET} {msg}") print(f" {YELLOW}[!]{RESET} {msg}")
def error(msg: str) -> None: def error(msg: str) -> None:
print(f" {RED}✘{RESET} {msg}") print(f" {RED}[-]{RESET} {msg}")
def banner() -> None: def banner() -> None:
print(f""" print(f"""
{BOLD}┌──────────────────────────────────────────────────────────┐ {BOLD}+----------------------------------------------------------+
│ HestiaCP + Django + Gunicorn — Deployment Engine │ | HestiaCP + Django + Gunicorn - Deployment Engine |
│ Prepared by MohammadAmin Baranzehi (amin.baranzehi.com) │ | Prepared by MohammadAmin Baranzehi (amin.baranzehi.com) |
└──────────────────────────────────────────────────────────┘{RESET} +----------------------------------------------------------+{RESET}
""") """)

View File

@@ -254,28 +254,29 @@ def print_report(report: DiagnosticReport) -> None:
GREEN = "\033[92m" GREEN = "\033[92m"
YELLOW = "\033[93m" YELLOW = "\033[93m"
RED = "\033[91m" RED = "\033[91m"
CYAN = "\033[96m"
BOLD = "\033[1m" BOLD = "\033[1m"
dc = report.domain_config dc = report.domain_config
print(f"\n{BOLD}╔══════════════════════════════════════════════════════╗{RESET}") print(f"\n{BOLD}+======================================================+{RESET}")
print(f"{BOLD}║ Deployment Doctor — {dc.domain:<33}║{RESET}") print(f"{BOLD}| Deployment Doctor - {dc.domain:<32}|{RESET}")
print(f"{BOLD}╚══════════════════════════════════════════════════════╝{RESET}\n") print(f"{BOLD}+======================================================+{RESET}\n")
status_icons = { status_icons = {
DiagnosticStatus.OK: f"{GREEN}✔{RESET}", DiagnosticStatus.OK: f"{GREEN}[+]{RESET}",
DiagnosticStatus.WARNING: f"{YELLOW}⚠{RESET}", DiagnosticStatus.WARNING: f"{YELLOW}[!]{RESET}",
DiagnosticStatus.CRITICAL: f"{RED}✘{RESET}", DiagnosticStatus.CRITICAL: f"{RED}[-]{RESET}",
} }
for check in report.checks: for check in report.checks:
icon = status_icons.get(check.status, "?") icon = status_icons.get(check.status, "[?]")
print(f" {icon} {BOLD}{check.name}{RESET}: {check.message}") print(f" {icon} {BOLD}{check.name}{RESET}: {check.message}")
if check.suggestion: if check.suggestion:
print(f" └─ suggestion: {check.suggestion}") print(f" [-] suggestion: {check.suggestion}")
print() print()
if report.is_healthy: if report.is_healthy:
print(f" {GREEN}{BOLD}All checks passed! Your deployment is healthy.{RESET}\n") print(f" {GREEN}{BOLD}[+] All checks passed! Your deployment is healthy.{RESET}\n")
else: else:
c = report.critical_count c = report.critical_count
w = report.warning_count w = report.warning_count

10
hdg
View File

@@ -36,10 +36,10 @@ CYAN='\033[0;96m'
BOLD='\033[1m' BOLD='\033[1m'
NC='\033[0m' NC='\033[0m'
info() { echo -e " ${CYAN}→${NC} $*"; } info() { echo -e " ${CYAN}[*]${NC} $*"; }
success() { echo -e " ${GREEN}✔${NC} $*"; } success() { echo -e " ${GREEN}[+]${NC} $*"; }
warn() { echo -e " ${YELLOW}⚠${NC} $*"; } warn() { echo -e " ${YELLOW}[!]${NC} $*"; }
error() { echo -e " ${RED}✘${NC} $*"; } error() { echo -e " ${RED}[-]${NC} $*"; }
# ── Self-installation to /usr/local/bin ─────────────────────────────────── # ── Self-installation to /usr/local/bin ───────────────────────────────────
install_global_links() { install_global_links() {
@@ -189,7 +189,7 @@ SERVICE_NAME="gunicorn-${DOMAIN}"
SERVICE_FILE="/etc/systemd/system/${SERVICE_NAME}.service" SERVICE_FILE="/etc/systemd/system/${SERVICE_NAME}.service"
if [ ! -d "$WEBDIR" ]; then if [ ! -d "$WEBDIR" ]; then
error "Domain directory not found → $WEBDIR" error "Domain directory not found: $WEBDIR"
exit 1 exit 1
fi fi