| |
| """Test script to verify project structure""" |
|
|
| import os |
| import sys |
|
|
| def check_file_exists(filepath, description): |
| if os.path.exists(filepath): |
| print(f"[OK] {description}: {filepath}") |
| return True |
| else: |
| print(f"[MISSING] {description}: {filepath} NOT FOUND") |
| return False |
|
|
| def main(): |
| print("Design Token Extractor - Project Structure Check") |
| print("=" * 50) |
| |
| checks = [ |
| ("app.py", "Main application file"), |
| ("requirements.txt", "Dependencies file"), |
| ("README.md", "Documentation with HF config"), |
| ("utils/__init__.py", "Utils module init"), |
| ("utils/extractor.py", "Core extraction pipeline"), |
| ("utils/token_generator.py", "Token code generator"), |
| ("examples/", "Examples directory"), |
| ("models/", "Models directory"), |
| ("assets/", "Assets directory") |
| ] |
| |
| all_good = True |
| for filepath, description in checks: |
| if not check_file_exists(filepath, description): |
| all_good = False |
| |
| print("=" * 50) |
| if all_good: |
| print("[SUCCESS] All project files are in place!") |
| print("\nTo deploy to Hugging Face Spaces:") |
| print("1. Install Git LFS: git lfs install") |
| print("2. Add remote: git remote add hf https://huggingface.co/spaces/YOUR_USERNAME/DesignTokenExtractor") |
| print("3. Push to HF: git push hf main") |
| else: |
| print("[ERROR] Some files are missing. Please check the structure.") |
| |
| return 0 if all_good else 1 |
|
|
| if __name__ == "__main__": |
| sys.exit(main()) |