Check if a template is marked as draft.
(self, template_path: Path)
| 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: |
no test coverage detected