http://www.mediawiki.org/wiki/Special:Code/pywikipedia/9730
Revision: 9730
Author: russblau
Date: 2011-11-07 18:40:40 +0000 (Mon, 07 Nov 2011)
Log Message:
-----------
Add toponly option to Site.recentchanges()
Modified Paths:
--------------
branches/rewrite/pywikibot/site.py
Modified: branches/rewrite/pywikibot/site.py
===================================================================
--- branches/rewrite/pywikibot/site.py 2011-11-07 07:22:18 UTC (rev 9729)
+++ branches/rewrite/pywikibot/site.py 2011-11-07 18:40:40 UTC (rev 9730)
@@ -2015,14 +2015,13 @@
def recentchanges(self, start=None, end=None, reverse=False,
namespaces=None, pagelist=None, changetype=None,
showMinor=None, showBot=None, showAnon=None,
- showRedirects=None, showPatrolled=None, step=None,
- total=None):
+ showRedirects=None, showPatrolled=None, topOnly=False,
+ step=None, total=None):
"""Iterate recent changes.
@param start: Timestamp to start listing from
@param end: Timestamp to end listing at
@param reverse: if True, start with oldest changes (default: newest)
- @param limit: iterate no more than this number of entries
@param pagelist: iterate changes to pages in this list only
@param pagelist: list of Pages
@param changetype: only iterate changes of this type ("edit" for
@@ -2038,6 +2037,8 @@
False (and not None), only list edits to non-redirect pages
@param showPatrolled: if True, only list patrolled edits; if False
(and not None), only list non-patrolled edits
+ @param topOnly: if True, only list changes that are the latest revision
+ (default False)
"""
if start and end:
@@ -2069,6 +2070,8 @@
for p in pagelist)
if changetype:
rcgen.request["rctype"] = changetype
+ if topOnly:
+ rcgen.request["rctoponly"] = ""
filters = {'minor': showMinor,
'bot': showBot,
'anon': showAnon,
http://www.mediawiki.org/wiki/Special:Code/pywikipedia/9727
Revision: 9727
Author: xqt
Date: 2011-11-07 04:35:05 +0000 (Mon, 07 Nov 2011)
Log Message:
-----------
python 2.4 compatible (bug #3419295), follow up for r9725, r9726
Modified Paths:
--------------
trunk/pywikipedia/wikipedia.py
Modified: trunk/pywikipedia/wikipedia.py
===================================================================
--- trunk/pywikipedia/wikipedia.py 2011-11-05 13:57:45 UTC (rev 9726)
+++ trunk/pywikipedia/wikipedia.py 2011-11-07 04:35:05 UTC (rev 9727)
@@ -4437,7 +4437,7 @@
# TODO: why isn't this a Site method?
pages = list(pages) # if pages is an iterator, we need to make it a list
output(u'Getting %d pages %sfrom %s...'
- % (len(pages), u'via API ' if site.has_api() and debug else u'', site))
+ % (len(pages), (u'', u'via API ')[site.has_api() and debug], site))
limit = config.special_page_limit / 4 # default is 500/4, but It might have good point for server.
if len(pages) > limit:
# separate export pages for bulk-retrieve
http://www.mediawiki.org/wiki/Special:Code/pywikipedia/9726
Revision: 9726
Author: valhallasw
Date: 2011-11-05 13:57:45 +0000 (Sat, 05 Nov 2011)
Log Message:
-----------
critical fix: revert r9725
Modified Paths:
--------------
trunk/pywikipedia/wikipedia.py
Modified: trunk/pywikipedia/wikipedia.py
===================================================================
--- trunk/pywikipedia/wikipedia.py 2011-11-04 14:50:26 UTC (rev 9725)
+++ trunk/pywikipedia/wikipedia.py 2011-11-05 13:57:45 UTC (rev 9726)
@@ -4437,7 +4437,7 @@
# TODO: why isn't this a Site method?
pages = list(pages) # if pages is an iterator, we need to make it a list
output(u'Getting %d pages %sfrom %s...'
- % (len(pages), (u'', u'via API ')[site.has_api() and debug]))
+ % (len(pages), u'via API ' if site.has_api() and debug else u'', site))
limit = config.special_page_limit / 4 # default is 500/4, but It might have good point for server.
if len(pages) > limit:
# separate export pages for bulk-retrieve
http://www.mediawiki.org/wiki/Special:Code/pywikipedia/9725
Revision: 9725
Author: xqt
Date: 2011-11-04 14:50:26 +0000 (Fri, 04 Nov 2011)
Log Message:
-----------
python 2.4 compatible (bug #3419295)
Modified Paths:
--------------
trunk/pywikipedia/wikipedia.py
Modified: trunk/pywikipedia/wikipedia.py
===================================================================
--- trunk/pywikipedia/wikipedia.py 2011-11-03 07:13:50 UTC (rev 9724)
+++ trunk/pywikipedia/wikipedia.py 2011-11-04 14:50:26 UTC (rev 9725)
@@ -4437,7 +4437,7 @@
# TODO: why isn't this a Site method?
pages = list(pages) # if pages is an iterator, we need to make it a list
output(u'Getting %d pages %sfrom %s...'
- % (len(pages), u'via API ' if site.has_api() and debug else u'', site))
+ % (len(pages), (u'', u'via API ')[site.has_api() and debug]))
limit = config.special_page_limit / 4 # default is 500/4, but It might have good point for server.
if len(pages) > limit:
# separate export pages for bulk-retrieve
http://www.mediawiki.org/wiki/Special:Code/pywikipedia/9724
Revision: 9724
Author: a_engels
Date: 2011-11-03 07:13:50 +0000 (Thu, 03 Nov 2011)
Log Message:
-----------
bugfix: bot incorrectly noted edit conflicts on semiprotected pages
Modified Paths:
--------------
trunk/pywikipedia/wikipedia.py
Modified: trunk/pywikipedia/wikipedia.py
===================================================================
--- trunk/pywikipedia/wikipedia.py 2011-11-02 12:18:32 UTC (rev 9723)
+++ trunk/pywikipedia/wikipedia.py 2011-11-03 07:13:50 UTC (rev 9724)
@@ -1742,7 +1742,7 @@
# self.get() calls self._getEditPage without this parameter
self.get(force=True, change_edit_time=True)
newtime = self.editTime()
- if oldtime != newtime: # page was changed
+ if str(oldtime) != str(newtime): # page was changed
raise EditConflict(u'Page has been changed after first read.')
self._editrestriction = False
# If no comment is given for the change, use the default