MCPcopy Create free account
hub / github.com/RASAAS/docmcp-knowledge / get_draft_paths

Function get_draft_paths

scripts/generate_content_pr.py:320–344  ·  view source on GitHub ↗

Determine EN and ZH draft file paths based on update category.

(update: dict, timestamp: str)

Source from the content-addressed store, hash-verified

318# ---------------------------------------------------------------------------
319
320def get_draft_paths(update: dict, timestamp: str) -> tuple[Path, Path]:
321 """Determine EN and ZH draft file paths based on update category."""
322 category = update.get("category", "unknown")
323 source_id = update.get("source_id", "update").replace("/", "_")
324 slug = f"{source_id}_{timestamp}"
325
326 drafts_dir = ROOT / "drafts"
327
328 if category.startswith("eu_mdr/mdcg"):
329 en_path = drafts_dir / "en" / "eu_mdr" / f"mdcg_{slug}.md"
330 zh_path = drafts_dir / "zh" / "eu_mdr" / f"mdcg_{slug}.md"
331 elif category.startswith("fda/guidance"):
332 en_path = drafts_dir / "en" / "fda" / f"guidance_{slug}.md"
333 zh_path = drafts_dir / "zh" / "fda" / f"guidance_{slug}.md"
334 elif category.startswith("nmpa"):
335 en_path = drafts_dir / "en" / "nmpa" / f"update_{slug}.md"
336 zh_path = drafts_dir / "zh" / "nmpa" / f"update_{slug}.md"
337 elif category.startswith("eu_mdr"):
338 en_path = drafts_dir / "en" / "eu_mdr" / f"update_{slug}.md"
339 zh_path = drafts_dir / "zh" / "eu_mdr" / f"update_{slug}.md"
340 else:
341 en_path = drafts_dir / "en" / f"update_{slug}.md"
342 zh_path = drafts_dir / "zh" / f"update_{slug}.md"
343
344 return en_path, zh_path
345
346
347def select_generator(update: dict):

Callers 1

process_updatesFunction · 0.85

Calls 1

getMethod · 0.80

Tested by

no test coverage detected