[Pywikipedia-l] SVN: [6612] trunk/pywikipedia/checkimages.py

filnik at svn.wikimedia.org filnik at svn.wikimedia.org
Fri Apr 17 10:55:21 UTC 2009


Revision: 6612
Author:   filnik
Date:     2009-04-17 10:55:20 +0000 (Fri, 17 Apr 2009)

Log Message:
-----------
Little bugfix

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

Modified: trunk/pywikipedia/checkimages.py
===================================================================
--- trunk/pywikipedia/checkimages.py	2009-04-16 15:41:15 UTC (rev 6611)
+++ trunk/pywikipedia/checkimages.py	2009-04-17 10:55:20 UTC (rev 6612)
@@ -999,12 +999,12 @@
         try:
             if self.settings == None: self.settingsData = None
             else:
-                x = wikipedia.Page(self.site, self.settings)
+                wikiPage = wikipedia.Page(self.site, self.settings)
                 self.settingsData = list()
                 try:
-                    testo = x.get()
+                    testo = wikiPage.get()
                     rxp = r"<------- ------->\n\*[Nn]ame ?= ?['\"](.*?)['\"]\n\*([Ff]ind|[Ff]indonly)=(.*?)\n\*[Ii]magechanges=(.*?)\n\*[Ss]ummary=['\"](.*?)['\"]\n\*[Hh]ead=['\"](.*?)['\"]\n\*[Tt]ext ?= ?['\"](.*?)['\"]\n\*[Mm]ex ?= ?['\"]?(.*?)['\"]?$"
-                    r = re.compile(rxp, re.UNICODE|re.M)
+                    r = re.compile(rxp, re.UNICODE|re.DOTALL)
                     number = 1
                     for m in r.finditer(testo):
                         name = str(m.group(1))
@@ -1020,6 +1020,7 @@
                         number += 1
                     if self.settingsData == list():
                         wikipedia.output(u"You've set wrongly your settings, please take a look to the relative page. (run without them)")
+                        exit()
                         self.settingsData = None
                 except wikipedia.NoPage:
                     wikipedia.output(u"The settings' page doesn't exist!")





More information about the Pywikipedia-l mailing list