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:
@@ -412,8 +412,22 @@ def format_single_interview(analysis: Dict) -> str:
|
||||
|
||||
def main():
|
||||
import sys
|
||||
|
||||
if len(sys.argv) < 2:
|
||||
import argparse
|
||||
|
||||
parser = argparse.ArgumentParser(
|
||||
description="Customer Interview Analyzer - Extracts insights, patterns, and opportunities from user interviews"
|
||||
)
|
||||
parser.add_argument(
|
||||
"file", nargs="?", default=None,
|
||||
help="Interview transcript text file to analyze"
|
||||
)
|
||||
parser.add_argument(
|
||||
"--json", action="store_true",
|
||||
help="Output results as JSON"
|
||||
)
|
||||
args = parser.parse_args()
|
||||
|
||||
if not args.file:
|
||||
print("Usage: python customer_interview_analyzer.py <interview_file.txt>")
|
||||
print("\nThis tool analyzes customer interview transcripts to extract:")
|
||||
print(" - Pain points and frustrations")
|
||||
@@ -422,17 +436,14 @@ def main():
|
||||
print(" - Sentiment analysis")
|
||||
print(" - Key themes and quotes")
|
||||
sys.exit(1)
|
||||
|
||||
# Read interview transcript
|
||||
with open(sys.argv[1], 'r') as f:
|
||||
|
||||
with open(args.file, 'r') as f:
|
||||
interview_text = f.read()
|
||||
|
||||
# Analyze
|
||||
|
||||
analyzer = InterviewAnalyzer()
|
||||
analysis = analyzer.analyze_interview(interview_text)
|
||||
|
||||
# Output
|
||||
if len(sys.argv) > 2 and sys.argv[2] == 'json':
|
||||
|
||||
if args.json:
|
||||
print(json.dumps(analysis, indent=2))
|
||||
else:
|
||||
print(format_single_interview(analysis))
|
||||
|
||||
@@ -267,6 +267,9 @@ def generate_docker_compose(config: Dict[str, Any]) -> str:
|
||||
compose["volumes"]["mongodata"] = {}
|
||||
|
||||
# Manual YAML-like output (avoid pyyaml dependency)
|
||||
nl = "\n"
|
||||
depends_on = f" depends_on:{nl} - db" if db else ""
|
||||
vol_line = " pgdata:" if db == "postgresql" else " mongodata:" if db == "mongodb" else " {}"
|
||||
return f"""version: '3.8'
|
||||
|
||||
services:
|
||||
@@ -278,12 +281,12 @@ services:
|
||||
- .env
|
||||
volumes:
|
||||
- .:/app
|
||||
{f' depends_on:\\n - db' if db else ''}
|
||||
{depends_on}
|
||||
|
||||
{generate_db_service(db)}
|
||||
{generate_redis_service(config)}
|
||||
volumes:
|
||||
{f' pgdata:' if db == 'postgresql' else f' mongodata:' if db == 'mongodb' else ' {}'}
|
||||
{vol_line}
|
||||
"""
|
||||
|
||||
|
||||
|
||||
@@ -547,33 +547,44 @@ class DesignTokenGenerator:
|
||||
|
||||
def main():
|
||||
import sys
|
||||
|
||||
import argparse
|
||||
|
||||
parser = argparse.ArgumentParser(
|
||||
description="Design Token Generator - Creates consistent design system tokens for colors, typography, spacing, and more."
|
||||
)
|
||||
parser.add_argument(
|
||||
"brand_color", nargs="?", default="#0066CC",
|
||||
help="Hex brand color (default: #0066CC)"
|
||||
)
|
||||
parser.add_argument(
|
||||
"--style", choices=["modern", "classic", "playful"], default="modern",
|
||||
help="Design style (default: modern)"
|
||||
)
|
||||
parser.add_argument(
|
||||
"--format", choices=["json", "css", "scss", "summary"], default="json",
|
||||
dest="output_format",
|
||||
help="Output format (default: json)"
|
||||
)
|
||||
args = parser.parse_args()
|
||||
|
||||
generator = DesignTokenGenerator()
|
||||
|
||||
# Get parameters
|
||||
brand_color = sys.argv[1] if len(sys.argv) > 1 else "#0066CC"
|
||||
style = sys.argv[2] if len(sys.argv) > 2 else "modern"
|
||||
output_format = sys.argv[3] if len(sys.argv) > 3 else "json"
|
||||
|
||||
# Generate tokens
|
||||
tokens = generator.generate_complete_system(brand_color, style)
|
||||
|
||||
# Output
|
||||
if output_format == 'summary':
|
||||
tokens = generator.generate_complete_system(args.brand_color, args.style)
|
||||
|
||||
if args.output_format == 'summary':
|
||||
print("=" * 60)
|
||||
print("DESIGN SYSTEM TOKENS")
|
||||
print("=" * 60)
|
||||
print(f"\n🎨 Style: {style}")
|
||||
print(f"🎨 Brand Color: {brand_color}")
|
||||
print("\n📊 Generated Tokens:")
|
||||
print(f" • Colors: {len(tokens['colors'])} palettes")
|
||||
print(f" • Typography: {len(tokens['typography'])} categories")
|
||||
print(f" • Spacing: {len(tokens['spacing'])} values")
|
||||
print(f" • Shadows: {len(tokens['shadows'])} styles")
|
||||
print(f" • Breakpoints: {len(tokens['breakpoints'])} sizes")
|
||||
print("\n💾 Export formats available: json, css, scss")
|
||||
print(f"\n Style: {args.style}")
|
||||
print(f" Brand Color: {args.brand_color}")
|
||||
print("\n Generated Tokens:")
|
||||
print(f" - Colors: {len(tokens['colors'])} palettes")
|
||||
print(f" - Typography: {len(tokens['typography'])} categories")
|
||||
print(f" - Spacing: {len(tokens['spacing'])} values")
|
||||
print(f" - Shadows: {len(tokens['shadows'])} styles")
|
||||
print(f" - Breakpoints: {len(tokens['breakpoints'])} sizes")
|
||||
print("\n Export formats available: json, css, scss")
|
||||
else:
|
||||
print(generator.export_tokens(tokens, output_format))
|
||||
print(generator.export_tokens(tokens, args.output_format))
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
||||
Reference in New Issue
Block a user