[Pywikipedia-l] SVN: [4651] trunk/pywikipedia/pagegenerators.py

filnik at svn.wikimedia.org filnik at svn.wikimedia.org
Sun Dec 9 12:10:32 UTC 2007


Revision: 4651
Author:   filnik
Date:     2007-12-09 12:10:26 +0000 (Sun, 09 Dec 2007)

Log Message:
-----------
Adding a new generator, newImages()

Modified Paths:
--------------
    trunk/pywikipedia/pagegenerators.py

Modified: trunk/pywikipedia/pagegenerators.py
===================================================================
--- trunk/pywikipedia/pagegenerators.py	2007-12-09 12:09:34 UTC (rev 4650)
+++ trunk/pywikipedia/pagegenerators.py	2007-12-09 12:10:26 UTC (rev 4651)
@@ -195,6 +195,12 @@
     for page in site.uncategorizedimages(number=number, repeat=repeat):
         yield page
 
+def newImages(limit = 50, site = None, repeat = False):
+    if site is None:
+        site = wikipedia.getSite()
+    for page in site.newImages(limit, repeat=repeat):
+        yield page			
+
 def UnCategorizedPageGenerator(number = 100, repeat = False, site = None):
     if site is None:
         site = wikipedia.getSite()





More information about the Pywikipedia-l mailing list