[Pywikipedia-l] SVN: [5430] trunk/pywikipedia

nicdumz at svn.wikimedia.org nicdumz at svn.wikimedia.org
Thu May 22 19:46:57 UTC 2008


Revision: 5430
Author:   nicdumz
Date:     2008-05-22 19:46:57 +0000 (Thu, 22 May 2008)

Log Message:
-----------
Okay, getFileHistory is now back on track, sync'ed with MW trunk :)

Modified Paths:
--------------
    trunk/pywikipedia/imagecopy.py
    trunk/pywikipedia/wikipedia.py

Modified: trunk/pywikipedia/imagecopy.py
===================================================================
--- trunk/pywikipedia/imagecopy.py	2008-05-22 19:05:37 UTC (rev 5429)
+++ trunk/pywikipedia/imagecopy.py	2008-05-22 19:46:57 UTC (rev 5430)
@@ -303,7 +303,7 @@
                 skip = True            
             else:
                 # The first upload is last in the list.
-                username = imagepage.getLatestUploader()               
+                (datetime, username, resolution, size, comment) = imagepage.getFileVersionHistory().pop()
                 while True:
 
                     # Do the Tkdialog to accept/reject and change te name        

Modified: trunk/pywikipedia/wikipedia.py
===================================================================
--- trunk/pywikipedia/wikipedia.py	2008-05-22 19:05:37 UTC (rev 5429)
+++ trunk/pywikipedia/wikipedia.py	2008-05-22 19:46:57 UTC (rev 5430)
@@ -2580,13 +2580,11 @@
         Return value is a list of tuples containing (timestamp, username,
         resolution, filesize, comment).
 
-        Currently not working
-
         """
         result = []
         history = re.search('(?s)<table class="filehistory">.+?</table>', self.getImagePageHtml())
         if history:
-            lineR = re.compile(r'<tr>(?:<td>.*?</td>){1,2}<td.*?><a href=".+?">(?P<datetime>.+?)</a></td><td>(?P<resolution>.*?)<span.*?>\((?P<filesize>.+?)\)</span></td><td><a href=".+?"(?: class="new"|) title=".+?">(?P<username>.+?)</a>.*?</td><td>.*?<span class="comment">(?P<comment>.*?)</span></td></tr>')
+            lineR = re.compile(r'<tr>(?:<td>.*?</td>){1,2}<td.*?><a href=".+?">(?P<datetime>.+?)</a></td><td>(?P<resolution>.*?)<span.*?>\((?P<filesize>.+?)\) </span></td><td><a href=".+?"(?: class="new"|) title=".+?">(?P<username>.+?)</a>.*?</td><td>.*?<span class="comment">\((?P<comment>.*?)\)</span></td></tr>')
             if not lineR.search(history.group()):
                 # b/c code
                 lineR = re.compile(r'<tr>(?:<td>.*?</td>){1,2}<td><a href=".+?">(?P<datetime>.+?)</a></td><td><a href=".+?"(?: class="new"|) title=".+?">(?P<username>.+?)</a>.*?</td><td>(?P<resolution>.*?)</td><td class=".+?">(?P<filesize>.+?)</td><td>(?P<comment>.*?)</td></tr>')





More information about the Pywikipedia-l mailing list