http://www.mediawiki.org/wiki/Special:Code/pywikipedia/10236
Revision: 10236
Author: xqt
Date: 2012-05-24 06:59:31 +0000 (Thu, 24 May 2012)
Log Message:
-----------
update version to 1.20wmf3 from rewrite r10235
Modified Paths:
--------------
trunk/pywikipedia/family.py
Modified: trunk/pywikipedia/family.py
===================================================================
--- trunk/pywikipedia/family.py 2012-05-24 06:58:31 UTC (rev 10235)
+++ trunk/pywikipedia/family.py 2012-05-24 06:59:31 UTC (rev 10236)
@@ -3962,7 +3962,7 @@
"""Return MediaWiki version number as a string."""
# Don't use this, use versionnumber() instead. This only exists
# to not break family files.
- return '1.20wmf2'
+ return '1.20wmf3'
def versionnumber(self, code):
"""Return an int identifying MediaWiki version.
http://www.mediawiki.org/wiki/Special:Code/pywikipedia/10235
Revision: 10235
Author: xqt
Date: 2012-05-24 06:58:31 +0000 (Thu, 24 May 2012)
Log Message:
-----------
update version to 1.20wmf3
Modified Paths:
--------------
branches/rewrite/pywikibot/family.py
Modified: branches/rewrite/pywikibot/family.py
===================================================================
--- branches/rewrite/pywikibot/family.py 2012-05-24 06:57:45 UTC (rev 10234)
+++ branches/rewrite/pywikibot/family.py 2012-05-24 06:58:31 UTC (rev 10235)
@@ -822,7 +822,7 @@
"""Return MediaWiki version number as a string."""
# Don't use this, use versionnumber() instead. This only exists
# to not break family files.
- return '1.20wmf2'
+ return '1.20wmf3'
def versionnumber(self, code):
"""Return an int identifying MediaWiki version.
http://www.mediawiki.org/wiki/Special:Code/pywikipedia/10232
Revision: 10232
Author: xqt
Date: 2012-05-22 21:11:27 +0000 (Tue, 22 May 2012)
Log Message:
-----------
new getCreator method: function to get the first editor and time stamp of a page
Modified Paths:
--------------
trunk/pywikipedia/wikipedia.py
Modified: trunk/pywikipedia/wikipedia.py
===================================================================
--- trunk/pywikipedia/wikipedia.py 2012-05-20 19:56:01 UTC (rev 10231)
+++ trunk/pywikipedia/wikipedia.py 2012-05-22 21:11:27 UTC (rev 10232)
@@ -223,6 +223,8 @@
getVersionHistoryTable: Create a wiki table from the history data
fullVersionHistory : Return all past versions including wikitext
contributingUsers : Return set of users who have edited page
+ getCreator : Function to get the first editor of a page
+ getLatestEditors : Function to get the last editors of a page
exists (*) : True if the page actually exists, false otherwise
isEmpty (*) : True if the page has 4 characters or less content,
not counting interwiki and category links
@@ -1038,7 +1040,6 @@
"""
return self._editTime
-
def previousRevision(self):
"""Return the revision id for the previous revision of this Page."""
vh = self.getVersionHistory(revCount=2)
@@ -2926,6 +2927,24 @@
users = set([edit[2] for edit in edits])
return users
+ def getCreator(self):
+ """ Function to get the first editor and time stamp of a page """
+ inf = getVersionHistory(reverseOrder=True, revCount=1)[0]
+ return inf[2], inf[1]
+
+ def getLatestEditors(self, limit=1):
+ """ Function to get the last editors of a page """
+ #action=query&prop=revisions&titles=API&rvprop=timestamp|user|comment
+ if hasattr(self, '_versionhistory'):
+ data = self.getVersionHistory(getAll=True, revCount=limit)
+ else:
+ data = self.getVersionHistory(revCount = limit)
+
+ result = []
+ for i in data:
+ result.append({'user':i[2], 'timestamp':i[1]})
+ return result
+
def watch(self, unwatch=False):
"""Add this page to the watchlist"""
if self.site().has_api:
@@ -3729,21 +3748,7 @@
else:
return new_text
- def getLatestEditors(self, limit = 1):
- """ Function to get the last editors of a page """
- #action=query&prop=revisions&titles=API&rvprop=timestamp|user|comment
- if hasattr(self, '_versionhistory'):
- data = self.getVersionHistory(getAll=True, revCount = limit)
- else:
- data = self.getVersionHistory(revCount = limit)
- result = []
- for i in data:
- result.append({'user':i[2],'timestamp':i[1]})
-
- return result
-
-
class ImagePage(Page):
"""A subclass of Page representing an image descriptor wiki page.