Build a lightweight meta entry from a document dict.
(doc: dict)
| 131 | |
| 132 | @staticmethod |
| 133 | def _make_meta_entry(doc: dict) -> dict: |
| 134 | """Build a lightweight meta entry from a document dict.""" |
| 135 | entry = { |
| 136 | 'type': doc.get('type', ''), |
| 137 | 'doc_name': doc.get('doc_name', ''), |
| 138 | 'doc_description': doc.get('doc_description', ''), |
| 139 | 'path': doc.get('path', ''), |
| 140 | } |
| 141 | if doc.get('type') == 'pdf': |
| 142 | entry['page_count'] = doc.get('page_count') |
| 143 | elif doc.get('type') == 'md': |
| 144 | entry['line_count'] = doc.get('line_count') |
| 145 | return entry |
| 146 | |
| 147 | @staticmethod |
| 148 | def _read_json(path) -> dict | None: |
no outgoing calls
no test coverage detected