89 lines
2.6 KiB
Python
Executable File
89 lines
2.6 KiB
Python
Executable File
#!/usr/bin/env python3
|
|
"""Environment validation script for GTD Terminal Tools."""
|
|
|
|
import sys
|
|
from pathlib import Path
|
|
|
|
# Add src to path for imports
|
|
sys.path.insert(0, str(Path(__file__).parent))
|
|
|
|
from src.utils.platform import validate_environment
|
|
|
|
|
|
def main():
|
|
"""Run environment validation and exit with appropriate code."""
|
|
env_info = validate_environment()
|
|
|
|
print("GTD Terminal Tools - Environment Validation")
|
|
print("=" * 50)
|
|
|
|
# Platform info
|
|
platform_info = env_info["platform_info"]
|
|
print(f"Platform: {platform_info['system']} {platform_info['release']}")
|
|
print(
|
|
f"Python: {platform_info['python_version']} ({platform_info['python_implementation']})"
|
|
)
|
|
print(f"Supported: {'✓' if env_info['platform_supported'] else '✗'}")
|
|
print()
|
|
|
|
# Dependencies
|
|
print("Dependencies:")
|
|
all_deps_available = True
|
|
for dep, available in env_info["dependencies"].items():
|
|
status = "✓" if available else "✗"
|
|
print(f" {dep}: {status}")
|
|
if not available:
|
|
all_deps_available = False
|
|
print()
|
|
|
|
# Terminal compatibility
|
|
print("Terminal Compatibility:")
|
|
terminal_ok = True
|
|
for feature, supported in env_info["terminal_compatibility"].items():
|
|
status = "✓" if supported else "✗"
|
|
print(f" {feature}: {status}")
|
|
if not supported and feature in ["color_support", "textual_support"]:
|
|
terminal_ok = False
|
|
print()
|
|
|
|
# Directories
|
|
print("Directories:")
|
|
for dir_type, dir_path in [
|
|
("config", "config_dir"),
|
|
("data", "data_dir"),
|
|
("logs", "log_dir"),
|
|
]:
|
|
path = Path(env_info[dir_path])
|
|
exists = path.exists()
|
|
status = "✓" if exists else "✗"
|
|
print(f" {dir_type.capitalize()}: {env_info[dir_path]} {status}")
|
|
print()
|
|
|
|
# Recommendations
|
|
if env_info["recommendations"]:
|
|
print("Recommendations:")
|
|
for rec in env_info["recommendations"]:
|
|
print(f" • {rec}")
|
|
print()
|
|
|
|
# Overall status
|
|
platform_ok = env_info["platform_supported"]
|
|
overall_ok = platform_ok and all_deps_available and terminal_ok
|
|
|
|
if overall_ok:
|
|
print("✓ Environment is ready for GTD Terminal Tools")
|
|
sys.exit(0)
|
|
else:
|
|
print("✗ Environment has issues that need to be addressed")
|
|
if not platform_ok:
|
|
print(" - Unsupported platform or Python version")
|
|
if not all_deps_available:
|
|
print(" - Missing dependencies")
|
|
if not terminal_ok:
|
|
print(" - Terminal compatibility issues")
|
|
sys.exit(1)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|