MCPcopy
hub / github.com/ChristianLempa/boilerplates / _is_template_draft

Method _is_template_draft

cli/core/library.py:38–50  ·  view source on GitHub ↗

Check if a template is marked as draft.

(self, template_path: Path)

Source from the content-addressed store, hash-verified

36 self.library_type = library_type
37
38 def _is_template_draft(self, template_path: Path) -> bool:
39 """Check if a template is marked as draft."""
40 template_file = template_path / TEMPLATE_MANIFEST_FILENAME
41 if not template_file.exists():
42 return False
43
44 try:
45 with template_file.open(encoding="utf-8") as f:
46 data = json.load(f) or {}
47 return bool(data.get("metadata", {}).get("draft", False))
48 except (json.JSONDecodeError, OSError) as e:
49 logger.warning(f"Error checking draft status for {template_path}: {e}")
50 return False
51
52 @staticmethod
53 def _has_template_manifest(template_path: Path) -> bool:

Callers 2

find_by_idMethod · 0.95
findMethod · 0.95

Calls 1

warningMethod · 0.45

Tested by

no test coverage detected