[feature:track_progress] Implemented main progress tracking system [feature:git_integration] Added Git history analysis with commit tag parsing [feature:template_engine] Created flexible template engine for documentation generation [feature:feature_tracking] Implemented feature status tracking and updates [feature:changelog_generation] Added automatic changelog generation from commits [feature:code_stats] Added code statistics and metrics collection [feature:roadmap_generation] Implemented roadmap generation [new-feature:launcher_scripts:Created cross-platform launcher scripts for easy execution] [new-feature:executable_build:Added Nuitka-based executable build system] [new-feature:project_installation:Created setup script for easy installation to projects] [status:track_progress_and_feature_statuses] Completed automatic status document generation [status:git_integration] Completed parsing Git logs for status updates [status:doc_generation] Completed auto-generation of status docs and changelog [changelog:Added comprehensive progress tracking system] [changelog:Added feature status tracking with Git integration] [changelog:Added customizable template system for documentation] [changelog:Added automatic changelog generation from commit messages] [changelog:Added code statistics and metrics collection] [changelog:Added cross-platform launcher scripts] [changelog:Added executable build system using Nuitka] [changelog:Added project installation script] [milestone:v1.0] Completed initial release of progress tracking system
88 lines
2.7 KiB
Python
88 lines
2.7 KiB
Python
"""
|
|
Configuration management for project status documentation.
|
|
"""
|
|
|
|
import os
|
|
import json
|
|
from typing import Dict, Any, List, Optional
|
|
|
|
|
|
class Config:
|
|
"""Configuration manager for project status documentation."""
|
|
|
|
def __init__(self, config_file: str = "scripts/progress_config.json"):
|
|
"""Initialize with configuration file."""
|
|
self.config_file = config_file
|
|
self.config = self._load_config()
|
|
|
|
def _load_config(self) -> Dict[str, Any]:
|
|
"""Load configuration from file."""
|
|
default_config = {
|
|
"project_name": "Project",
|
|
"output_dir": "docs/status",
|
|
"status_doc": "status.md",
|
|
"features_file": "docs/features.md",
|
|
"changelog_file": "CHANGELOG.md",
|
|
"git_log_limit": 100,
|
|
"untagged_commit_limit": 50,
|
|
"top_files_limit": 20,
|
|
"exclude_dirs": [
|
|
"node_modules",
|
|
"venv",
|
|
".git",
|
|
".vs",
|
|
"bin",
|
|
"obj",
|
|
],
|
|
"source_extensions": [".py", ".cs", ".js", ".ts", ".html", ".css"],
|
|
"templates": {
|
|
"status": "status_template.md",
|
|
"features": "feature_template.md",
|
|
"changelog": "changelog_template.md",
|
|
},
|
|
}
|
|
|
|
if not os.path.exists(self.config_file):
|
|
return default_config
|
|
|
|
try:
|
|
with open(self.config_file, "r", encoding="utf-8") as f:
|
|
config = json.load(f)
|
|
|
|
# Merge with default config to ensure all keys exist
|
|
merged_config = default_config.copy()
|
|
merged_config.update(config)
|
|
|
|
return merged_config
|
|
except Exception:
|
|
return default_config
|
|
|
|
def get(self, key: str, default: Any = None) -> Any:
|
|
"""Get a configuration value."""
|
|
if "." in key:
|
|
# Handle nested keys like "templates.status"
|
|
parts = key.split(".")
|
|
value = self.config
|
|
for part in parts:
|
|
if isinstance(value, dict) and part in value:
|
|
value = value[part]
|
|
else:
|
|
return default
|
|
return value
|
|
|
|
return self.config.get(key, default)
|
|
|
|
def set(self, key: str, value: Any) -> None:
|
|
"""Set a configuration value."""
|
|
if "." in key:
|
|
# Handle nested keys
|
|
parts = key.split(".")
|
|
config = self.config
|
|
for part in parts[:-1]:
|
|
if part not in config:
|
|
config[part] = {}
|
|
config = config[part]
|
|
config[parts[-1]] = value
|
|
else:
|
|
self.config[key] = value
|