[Pywikipedia-l] SVN: [6450] branches/rewrite/pywikibot

russblau at svn.wikimedia.org russblau at svn.wikimedia.org
Fri Feb 27 21:47:31 UTC 2009


Revision: 6450
Author:   russblau
Date:     2009-02-27 21:47:31 +0000 (Fri, 27 Feb 2009)

Log Message:
-----------
Bugs in category redirect detection and category preloading

Modified Paths:
--------------
    branches/rewrite/pywikibot/page.py
    branches/rewrite/pywikibot/site.py

Modified: branches/rewrite/pywikibot/page.py
===================================================================
--- branches/rewrite/pywikibot/page.py	2009-02-27 16:55:46 UTC (rev 6449)
+++ branches/rewrite/pywikibot/page.py	2009-02-27 21:47:31 UTC (rev 6450)
@@ -420,7 +420,7 @@
                 if template.title(withNamespace=False) in catredirs:
                     # Get target (first template argument)
                     self._catredirect = self.site().namespace(14) \
-                                         + ":" + args[0]
+                                         + ":" + args[0].strip()
                     break
             else:
                 self._catredirect = False

Modified: branches/rewrite/pywikibot/site.py
===================================================================
--- branches/rewrite/pywikibot/site.py	2009-02-27 16:55:46 UTC (rev 6449)
+++ branches/rewrite/pywikibot/site.py	2009-02-27 21:47:31 UTC (rev 6450)
@@ -1011,7 +1011,8 @@
                                       if hasattr(p, "_pageid")
                                          and p._pageid > 0]
             cache = dict((p.title(withSection=False), p) for p in sublist)
-            rvgen = api.PropertyGenerator("revisions|info", site=self)
+            rvgen = api.PropertyGenerator("revisions|info|categoryinfo",
+                                          site=self)
             rvgen.set_maximum_items(-1) # suppress use of "rvlimit" parameter
             if len(pageids) == len(sublist):
                 # only use pageids if all pages have them





More information about the Pywikipedia-l mailing list