fix: repair 25 Python scripts failing --help across all domains
- Fix Python 3.10+ syntax (float | None → Optional[float]) in 2 scripts - Add argparse CLI handling to 9 marketing scripts using raw sys.argv - Fix 10 scripts crashing at module level (wrap in __main__, add argparse) - Make yaml/prefect/mcp imports conditional with stdlib fallbacks (4 scripts) - Fix f-string backslash syntax in project_bootstrapper.py - Fix -h flag conflict in pr_analyzer.py - Fix tech-debt.md description (score → prioritize) All 237 scripts now pass python3 --help verification. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -19,7 +19,22 @@ import ast
|
||||
import json
|
||||
import re
|
||||
import sys
|
||||
import yaml
|
||||
try:
|
||||
import yaml
|
||||
except ImportError:
|
||||
# Minimal YAML subset: parse simple key: value frontmatter without pyyaml
|
||||
class _YamlStub:
|
||||
class YAMLError(Exception):
|
||||
pass
|
||||
@staticmethod
|
||||
def safe_load(text):
|
||||
result = {}
|
||||
for line in text.strip().splitlines():
|
||||
if ':' in line:
|
||||
key, _, value = line.partition(':')
|
||||
result[key.strip()] = value.strip()
|
||||
return result if result else None
|
||||
yaml = _YamlStub()
|
||||
import datetime as dt
|
||||
from pathlib import Path
|
||||
from typing import Dict, List, Any, Optional, Tuple
|
||||
|
||||
Reference in New Issue
Block a user