build: wikitool new project - Seite und Tracker-Projekt unter einem Namen (#126)
Files changed: - CHANGES.md - VERSION - tools/CONTRACT.md - tools/chemenu/commands/new_page.py - tools/chemenu/errors.py - tools/chemenu/review.py - tools/chemenu/tasks/__init__.py - tools/chemenu/tests/test_new_page.py
This commit is contained in:
1 parent
80b57e0d01
commit
e4260fc2de
8 files changed
+342
-24
No files matched your search
+3
-14
@@ -25,8 +25,9 @@ from typing import Optional
|
||||
|
||||
from chemenu import config, kb_scan
|
||||
from chemenu.errors import ValidationError
|
||||
from chemenu.tasks import build_reader
|
||||
from chemenu.tasks import config as tasks_config
|
||||
from chemenu.tasks.protocol import OpenItems, TaskReader, normalize_project_name
|
||||
from chemenu.tasks.protocol import OpenItems, normalize_project_name
|
||||
|
||||
CHECK_STALLED = "stalled"
|
||||
CHECK_WAITING_OVERDUE = "waiting_overdue"
|
||||
@@ -91,18 +92,6 @@ def _load_kb_projects(kb_dir: Path) -> dict[str, _KbProject]:
|
||||
return result
|
||||
|
||||
|
||||
def _build_reader(cfg: tasks_config.TasksConfig) -> TaskReader:
|
||||
"""Dispatch on `cfg.provider` - the same inline shape
|
||||
`doctor.check_tasks_provider` uses, kept in sync with
|
||||
`tasks_config.KNOWN_PROVIDERS`."""
|
||||
if cfg.provider == "superproductivity":
|
||||
from chemenu.tasks import superproductivity as sp
|
||||
|
||||
sp_cfg = sp.SuperProductivityConfig.from_dict(cfg.provider_config)
|
||||
return sp.SuperProductivityReader(sp_cfg)
|
||||
raise ValidationError(f"No reader is wired up for task provider {cfg.provider!r}.")
|
||||
|
||||
|
||||
def _weeks_between(start: date, end: date) -> float:
|
||||
return (end - start).days / 7
|
||||
|
||||
@@ -136,7 +125,7 @@ def run_review(root: Path, *, today: Optional[date] = None) -> ReviewReport:
|
||||
f"No {config.TASKS_CONFIG_FILENAME} - no task tracker is configured, so there is "
|
||||
"nothing to join the weekly review against. Configure one first."
|
||||
)
|
||||
reader = _build_reader(cfg)
|
||||
reader = build_reader(cfg)
|
||||
kb_projects = _load_kb_projects(Path(root) / "kb")
|
||||
|
||||
findings: list[Finding] = []
|
||||
|
||||
Reference in new issue
Block a user