Package pywikipedia :: Module category :: Class CategoryDatabase
[show private | hide private]
[frames | no frames]

Class CategoryDatabase


This is a temporary knowledge base saving for each category the contained subcategories and articles, so that category pages don't need to be loaded over and over again
Method Summary
  __init__(self, rebuild, filename)
  dump(self, filename)
Saves the contents of the dictionaries superclassDB and catContentDB to disk.
  getArticles(self, cat)
For a given category, return a list of Pages for all its articles.
  getSubcats(self, supercat)
For a given supercategory, return a list of Categorys for all its subcategories.
  getSupercats(self, subcat)
  rebuild(self)

Method Details

dump(self, filename='category.dump.bz2')

Saves the contents of the dictionaries superclassDB and catContentDB to disk.

getArticles(self, cat)

For a given category, return a list of Pages for all its articles. Saves this list in a temporary database so that it won't be loaded from the server next time it's required.

getSubcats(self, supercat)

For a given supercategory, return a list of Categorys for all its subcategories. Saves this list in a temporary database so that it won't be loaded from the server next time it's required.

Generated by Epydoc 2.1 on Sun Jul 03 17:07:38 2005 http://epydoc.sf.net