Revision: 5654 Author: jayvdb Date: 2008-06-29 09:53:10 +0000 (Sun, 29 Jun 2008)
Log Message: ----------- Handle localised name for "Page" namespace
Modified Paths: -------------- trunk/pywikipedia/djvutext.py
Modified: trunk/pywikipedia/djvutext.py =================================================================== --- trunk/pywikipedia/djvutext.py 2008-06-29 08:45:11 UTC (rev 5653) +++ trunk/pywikipedia/djvutext.py 2008-06-29 09:53:10 UTC (rev 5654) @@ -90,6 +90,9 @@
linkingPage = wikipedia.Page(wikipedia.getSite(), self.index) self.prefix = linkingPage.titleWithoutNamespace() + if self.prefix[0:6] == 'Liber:': + self.prefix = self.prefix[6:] + wikipedia.output("Using prefix %s" % self.prefix) gen = self.PagesGenerator()
site = wikipedia.getSite() @@ -103,7 +106,9 @@ """ Loads the given page, does some changes, and saves it. """ - page = wikipedia.Page(wikipedia.getSite(), 'Page:%s/%d' % (self.prefix, pageno) ) + site = wikipedia.getSite() + page_namespace = site.family.namespaces[104]['la'] + page = wikipedia.Page(site, '%s:%s/%d' % (page_namespace, self.prefix, pageno) ) exists = page.exists()
################################################################
pywikipedia-l@lists.wikimedia.org