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

Method list_structure

scripts/migrate_wordpress.py:293–308  ·  view source on GitHub ↗

Fetch all docs and show how they would be mapped.

(self)

Source from the content-addressed store, hash-verified

291 json.dump(index_data, f, ensure_ascii=False, indent=2)
292
293 def list_structure(self) -> None:
294 """Fetch all docs and show how they would be mapped."""
295 print("\nFetching all docs to analyze structure...\n")
296 docs = self.get_all_docs()
297 print(f"\nTotal docs: {len(docs)}\n")
298
299 path_counts: Dict[str, int] = {}
300 for doc in docs:
301 link = doc.get("link", "")
302 output_path, _ = self.detect_output_path(link)
303 path_counts[output_path] = path_counts.get(output_path, 0) + 1
304
305 print("Mapping summary:")
306 for path, count in sorted(path_counts.items()):
307 print(f" {path:<50} {count:3d} docs")
308 print(f"\n Total: {len(docs)} docs across {len(path_counts)} directories")
309
310 def migrate(self, url_filter: Optional[str] = None) -> None:
311 """Main migration entry point."""

Callers 1

mainFunction · 0.95

Calls 3

get_all_docsMethod · 0.95
detect_output_pathMethod · 0.95
getMethod · 0.80

Tested by

no test coverage detected