[Pywikipedia-svn] SVN: [7269] branches/rewrite/scripts/imageuncat.py

nicdumz at svn.wikimedia.org nicdumz at svn.wikimedia.org
Thu Sep 17 17:11:25 UTC 2009


Revision: 7269
Author:   nicdumz
Date:     2009-09-17 17:11:25 +0000 (Thu, 17 Sep 2009)

Log Message:
-----------
quick rcgen for Multichill

Modified Paths:
--------------
    branches/rewrite/scripts/imageuncat.py

Modified: branches/rewrite/scripts/imageuncat.py
===================================================================
--- branches/rewrite/scripts/imageuncat.py	2009-09-17 15:52:03 UTC (rev 7268)
+++ branches/rewrite/scripts/imageuncat.py	2009-09-17 17:11:25 UTC (rev 7269)
@@ -1273,7 +1273,11 @@
     rcstart = site.getcurrenttime() + timedelta(minutes=-delay-block)
     rcend = site.getcurrenttime() + timedelta(minutes=-delay)
 
-    return site.recentchanges(start=rcstart, end=rcend, reverse=True, namespaces=6, changetype='edit|log', showBot=False) 
+    gen = site.recentchanges(start=rcstart, end=rcend, reverse=True, namespaces=6, changetype='edit|log', showBot=False) 
+    # remove 'patrolled' from rcprop since we can't get it
+    gen.request['rcprop'] = 'title|user|comment|ids'
+    for p in gen:
+        yield pywikibot.Page(site, p['title'], p['ns'])
 
 def isUncat(page):
     '''
@@ -1342,7 +1346,7 @@
     if not generator:
         pywikibot.output('You have to specify the generator you want to use for the program!')
     else:
-        pregenerator = pagegenerators.PreloadingGenerator(generator)
+        pregenerator = site.preloadpages(generator)
         for page in pregenerator:
             print page.title()
             if page.exists() and (page.namespace() == 6) and (not page.isRedirectPage()) :





More information about the Pywikipedia-svn mailing list