jenkins-bot has submitted this change and it was merged.
Change subject: [PEP8] pep8 changes
......................................................................
[PEP8] pep8 changes
Change-Id: I9f6283462b2bed90b5d737ed976521901fb17506
---
M commons_category_redirect.py
1 file changed, 27 insertions(+), 19 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/commons_category_redirect.py b/commons_category_redirect.py
index 534bd13..b1a06a5 100644
--- a/commons_category_redirect.py
+++ b/commons_category_redirect.py
@@ -1,60 +1,67 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
-Script to clean up http://commons.wikimedia.org/wiki/Category:Non-empty_category_redirects
+Script to clean up
+http://commons.wikimedia.org/wiki/Category:Non-empty_category_redirects
-Moves all images, pages and categories in redirect categories to the target category.
+Moves all images, pages and categories in redirect categories to the target
+category.
"""
#
# (C) Multichill, 2008
-# (C) Pywikipedia team, 2008-2011
+# (C) Pywikibot team, 2008-2013
#
# Distributed under the terms of the MIT license.
#
__version__ = '$Id$'
-import wikipedia as pywikibot
-import config, catlib
-from category import *
from datetime import datetime
from datetime import timedelta
-redirect_templates = [u'Category redirect', u'Categoryredirect', u'See cat', u'Seecat', u'Catredirect', u'Cat redirect', u'CatRed', u'Catredir']
+import wikipedia as pywikibot
+import config
+import catlib
+from category import *
+
+redirect_templates = [u'Category redirect', u'Categoryredirect', u'See cat',
+ u'Seecat', u'Catredirect', u'Cat redirect', u'CatRed',
+ u'Catredir']
move_message = u'Moving from [[%s|%s]] to [[%s|%s]] (following [[Template:Category redirect|category redirect]])'
-cooldown = 7 # days
+cooldown = 7 # days
+
def get_redirect_cat(category=None):
- '''
- Return the target category
- '''
+ """ Return the target category """
destination = None
site = pywikibot.getSite(u'commons', u'commons')
for template in category.templatesWithParams():
if ((template[0] in redirect_templates) and (len(template[1]) > 0)):
#destination = template[1][0];
- destination =catlib.Category(site, template[1][0])
+ destination = catlib.Category(site, template[1][0])
if not destination.exists():
return None
return destination
+
def readyToEdit(old_category):
- ''' If the category is edited more recenty than cooldown, return false,
+ """ If the category is edited more recenty than cooldown, return false,
otherwise true.
- '''
- dateformat ="%Y%m%d%H%M%S"
+ """
+ dateformat = "%Y%m%d%H%M%S"
today = datetime.now()
deadline = today + timedelta(days=-cooldown)
old_category.get()
return (deadline.strftime(dateformat) > old_category.editTime())
+
def main():
- ''' Main loop. Loop over all categories of
+ """ Main loop. Loop over all categories of
Category:Non-empty_category_redirects and move all content.
- '''
+ """
site = pywikibot.getSite(u'commons', u'commons')
dirtycat = catlib.Category(site, u'Category:Non-empty category redirects')
@@ -62,8 +69,8 @@
catbot = None
for old_category in dirtycat.subcategories():
- # We want to wait several days after the last edit before we start moving
- # things around. This it to prevent edit wars and vandals.
+ # We want to wait several days after the last edit before we start
+ # moving things around. This it to prevent edit wars and vandals.
if(readyToEdit(old_category)):
destination = get_redirect_cat(old_category)
if destination:
@@ -94,6 +101,7 @@
except:
pywikibot.output(u'Dummy edit at %s failed' % old_category.title())
+
if __name__ == "__main__":
try:
main()
--
To view, visit https://gerrit.wikimedia.org/r/95812
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I9f6283462b2bed90b5d737ed976521901fb17506
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/compat
Gerrit-Branch: master
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot
Xqt has submitted this change and it was merged.
Change subject: [PEP8] remaining pep8 changes
......................................................................
[PEP8] remaining pep8 changes
Change-Id: I915cba5f57ee3f8e9901ccee039ca2fda932373e
---
M checkimages.py
1 file changed, 1 insertion(+), 1 deletion(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/checkimages.py b/checkimages.py
index da98deb..8f25dfc 100644
--- a/checkimages.py
+++ b/checkimages.py
@@ -1209,7 +1209,7 @@
# Don't report, but continue with the check
# (we don't now if this is the first time we check this file
# or not)
- return True
+ return True
# The talk page includes "_" between the two names, in this way I
# replace them to " "
--
To view, visit https://gerrit.wikimedia.org/r/95811
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I915cba5f57ee3f8e9901ccee039ca2fda932373e
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/compat
Gerrit-Branch: master
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot
jenkins-bot has submitted this change and it was merged.
Change subject: [PEP8] remaining pep8 fixes
......................................................................
[PEP8] remaining pep8 fixes
Change-Id: Ia6360fcec610cd7af413a24d779074f175663ed3
---
M blockreview.py
1 file changed, 15 insertions(+), 2 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/blockreview.py b/blockreview.py
index 43edc48..b59ed35 100644
--- a/blockreview.py
+++ b/blockreview.py
@@ -30,11 +30,24 @@
class BlockreviewBot:
# notes
note_admin = {
- 'de': u"\n\n== Sperrprüfungswunsch ==\nHallo %(admin)s, \n\n[[%(user)s]] wünscht diePrüfung seiner/ihrer Sperre vom %(time)s über die Dauer von %(duration)s. Kommentar war ''%(comment)s''. Bitte äußere Dich dazu auf der [[%(usertalk)s#%(section)s|Diskussionsseite]]. -~~~~"
+ 'de': u"""
+
+== Sperrprüfungswunsch ==
+Hallo %(admin)s,
+
+[[%(user)s]] wünscht die Prüfung seiner/ihrer Sperre vom %(time)s über die Dauer von %(duration)s. Kommentar war ''%(comment)s''. Bitte äußere Dich dazu auf der [[%(usertalk)s#%(section)s|Diskussionsseite]]. -~~~~"""
}
note_project = {
- 'de': u"\n\n== [[%(user)s]] ==\n* gesperrt am %(time)s durch {{Benutzer|%(admin)s}} für eine Dauer von %(duration)s.\n* Kommentar war ''%(comment)s''.\n* [[Benutzer:%(admin)s]] wurde [[Benutzer Diskussion:%(admin)s#Sperrprüfungswunsch|benachrichtigt]].\n* [[%(usertalk)s#%(section)s|Link zur Diskussion]]\n:<small>-~~~~</small>\n;Antrag entgegengenommen"
+ 'de': u"""
+
+== [[%(user)s]] ==
+* gesperrt am %(time)s durch {{Benutzer|%(admin)s}} für eine Dauer von %(duration)s.
+* Kommentar war ''%(comment)s''.
+* [[Benutzer:%(admin)s]] wurde [[Benutzer Diskussion:%(admin)s#Sperrprüfungswunsch|benachrichtigt]].
+* [[%(usertalk)s#%(section)s|Link zur Diskussion]]
+:<small>-~~~~</small>
+;Antrag entgegengenommen"""
}
# edit summaries
--
To view, visit https://gerrit.wikimedia.org/r/95808
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ia6360fcec610cd7af413a24d779074f175663ed3
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/compat
Gerrit-Branch: master
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot
jenkins-bot has submitted this change and it was merged.
Change subject: [PEP8] remaining pep8 changes
......................................................................
[PEP8] remaining pep8 changes
Change-Id: I24123d8ed01b938e072b372ef7ba77f678c1c354
---
M casechecker.py
1 file changed, 1 insertion(+), 1 deletion(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/casechecker.py b/casechecker.py
index 80fede6..94f82bd 100644
--- a/casechecker.py
+++ b/casechecker.py
@@ -27,7 +27,7 @@
yield []
else:
for i in xrange(len(items)):
- for cc in xuniqueCombinations(items[i+1:], n-1):
+ for cc in xuniqueCombinations(items[i + 1:], n - 1):
yield [items[i]] + cc
# End of permutation code
#
--
To view, visit https://gerrit.wikimedia.org/r/95809
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I24123d8ed01b938e072b372ef7ba77f678c1c354
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/compat
Gerrit-Branch: master
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot
jenkins-bot has submitted this change and it was merged.
Change subject: new mw release 1.23wmf3
......................................................................
new mw release 1.23wmf3
Change-Id: I007bfe585cb064872d7e6400da26cd0b04d19978
---
M pywikibot/family.py
1 file changed, 1 insertion(+), 1 deletion(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/family.py b/pywikibot/family.py
index 81b4ff1..71d8a38 100644
--- a/pywikibot/family.py
+++ b/pywikibot/family.py
@@ -1065,7 +1065,7 @@
"""Return Wikimedia projects version number as a string."""
# Don't use this, use versionnumber() instead. This only exists
# to not break family files.
- return '1.23wmf2'
+ return '1.23wmf3'
def shared_image_repository(self, code):
return ('commons', 'commons')
--
To view, visit https://gerrit.wikimedia.org/r/95805
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I007bfe585cb064872d7e6400da26cd0b04d19978
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot
Xqt has submitted this change and it was merged.
Change subject: new mw release 1.23wmf3
......................................................................
new mw release 1.23wmf3
Change-Id: If2cfd1c52f4f47e51a0cfe9227eb97931a4ddedb
---
M family.py
1 file changed, 1 insertion(+), 1 deletion(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/family.py b/family.py
index 8ed8df0..56398bd 100644
--- a/family.py
+++ b/family.py
@@ -4857,7 +4857,7 @@
"""Return Wikimedia projects version number as a string."""
# Don't use this, use versionnumber() instead. This only exists
# to not break family files.
- return '1.23wmf2'
+ return '1.23wmf3'
def shared_image_repository(self, code):
return ('commons', 'commons')
--
To view, visit https://gerrit.wikimedia.org/r/95804
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: If2cfd1c52f4f47e51a0cfe9227eb97931a4ddedb
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/compat
Gerrit-Branch: master
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot
Xqt has submitted this change and it was merged.
Change subject: Adding option of "-nobots" in order to filter edits of bots when people are using -recentchanges.
......................................................................
Adding option of "-nobots" in order to filter edits of bots when people are using -recentchanges.
Bug: 55044
Change-Id: I49d3681e3b35c491fda6f08155c798ffdc0a8bfb
---
M pagegenerators.py
M wikipedia.py
2 files changed, 17 insertions(+), 7 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pagegenerators.py b/pagegenerators.py
index 8decfb0..cfe273e 100644
--- a/pagegenerators.py
+++ b/pagegenerators.py
@@ -110,6 +110,8 @@
"-recentchanges:n" where n is the number of pages to be
returned, else 100 pages are returned.
+-rc-nobots Same as above but doesn't work on pages that bots have edited
+
-ref Work on all pages that link to a certain page.
Argument can also be given as "-ref:referredpagetitle".
@@ -352,9 +354,15 @@
gen = RandomRedirectPageGenerator(number=int(arg[16:]))
elif arg.startswith('-recentchanges'):
if len(arg) >= 15:
- gen = RecentchangesPageGenerator(number=int(arg[15:]))
+ gen = RecentchangesPageGenerator(number=int(arg[15:]), nobots=False)
else:
- gen = RecentchangesPageGenerator()
+ gen = RecentchangesPageGenerator(nobots=False)
+ gen = DuplicateFilterPageGenerator(gen)
+ elif arg.startswith('-rc-nobots'):
+ if len(arg) >= 11:
+ gen = RecentchangesPageGenerator(number=int(arg[11:]), nobots=True)
+ else:
+ gen = RecentchangesPageGenerator(nobots=True)
gen = DuplicateFilterPageGenerator(gen)
elif arg.startswith('-file'):
textfilename = arg[6:]
@@ -587,7 +595,7 @@
yield item[0]
-def RecentchangesPageGenerator(number=100, site=None):
+def RecentchangesPageGenerator(number=100, site=None, nobots=False):
"""Generate pages that are in the recent changes list.
@param number: iterate no more than this number of entries
@@ -595,7 +603,7 @@
"""
if site is None:
site = pywikibot.getSite()
- for item in site.recentchanges(number=number):
+ for item in site.recentchanges(number=number, nobots=nobots):
yield item[0]
diff --git a/wikipedia.py b/wikipedia.py
index c9bc07e..3a00767 100644
--- a/wikipedia.py
+++ b/wikipedia.py
@@ -8117,7 +8117,7 @@
def recentchanges(self, number=100, rcstart=None, rcend=None, rcshow=None,
rcdir='older', rctype='edit|new', namespace=None,
includeredirects=True, repeat=False, user=None,
- returndict=False):
+ returndict=False, nobots=False):
"""
Yield recent changes as Page objects
uses API call:
@@ -8176,9 +8176,11 @@
'loginfo',
'sizes'], # , 'flags', 'redirect', 'patrolled'],
'rcnamespace': namespace,
- 'rclimit': int(number),
}
-
+ if nobots:
+ params['rclimit'] = str(number) + "!bot"
+ else:
+ params['rclimit'] = int(number)
if user:
params['rcuser'] = user
if rcstart:
--
To view, visit https://gerrit.wikimedia.org/r/95327
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I49d3681e3b35c491fda6f08155c798ffdc0a8bfb
Gerrit-PatchSet: 2
Gerrit-Project: pywikibot/compat
Gerrit-Branch: master
Gerrit-Owner: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot