#!/usr/bin/env python3 """Simple template test without complex imports""" import sys import os import json # Test the template service directly templates_path = "/home/tony/chorus/project-queues/active/WHOOSH/backend/templates" print("๐Ÿงช Testing template system...") # Check if templates directory exists if os.path.exists(templates_path): print(f"โœ… Templates directory exists: {templates_path}") # List template directories template_dirs = [d for d in os.listdir(templates_path) if os.path.isdir(os.path.join(templates_path, d))] print(f"โœ… Found {len(template_dirs)} template directories: {template_dirs}") # Check each template for template_dir in template_dirs: template_path = os.path.join(templates_path, template_dir) metadata_file = os.path.join(template_path, "template.json") if os.path.exists(metadata_file): try: with open(metadata_file, 'r') as f: metadata = json.load(f) print(f"โœ… Template: {metadata['name']} ({metadata['template_id']})") print(f" Category: {metadata['category']}") print(f" Difficulty: {metadata['difficulty']}") print(f" Features: {len(metadata['features'])}") # Check for files directory files_dir = os.path.join(template_path, "files") if os.path.exists(files_dir): file_count = 0 for root, dirs, files in os.walk(files_dir): file_count += len(files) print(f" Files: {file_count}") else: print(f" Files: 0 (no files directory)") except Exception as e: print(f"โŒ Error reading template {template_dir}: {e}") else: print(f"โŒ Template {template_dir} missing metadata file") print() else: print(f"โŒ Templates directory not found: {templates_path}") print("๐ŸŽ‰ Template system test completed!")