jenkins-bot has submitted this change and it was merged.
Change subject: pep8 changes
......................................................................
pep8 changes
Change-Id: I4cf67a6b69a0a34b5dd2ebf9ef21904b6c3af563
---
M template.py
1 file changed, 16 insertions(+), 12 deletions(-)
Approvals:
Legoktm: Looks good to me, approved
jenkins-bot: Verified
diff --git a/template.py b/template.py
index 2fdb4ef..677890f 100644
--- a/template.py
+++ b/template.py
@@ -105,12 +105,16 @@
#
__version__='$Id$'
#
-import re, sys, string
+import re
+import sys
+import string
import wikipedia as pywikibot
from pywikibot import i18n
-import config, catlib
+import config
+import catlib
import pagegenerators as pg
import replace
+
def UserEditFilterGenerator(generator, username, timestamp=None, skip=False):
"""
@@ -153,15 +157,14 @@
* templateNames - A list of Page object representing the searched
templates
* xmlfilename - The dump's path, either absolute or relative
+
"""
self.templates = templates
self.xmlfilename = xmlfilename
def __iter__(self):
- """
- Yield page objects until the entire XML dump has been read.
- """
+ """Yield page objects until the entire XML dump has been read."""
import xmlreader
mysite = pywikibot.getSite()
dump = xmlreader.XmlDump(self.xmlfilename)
@@ -189,9 +192,10 @@
This robot will load all pages yielded by a page generator and replace or
remove all occurences of the old template, or substitute them with the
template's text.
+
"""
- def __init__(self, generator, templates, subst = False, remove = False,
- editSummary = '', acceptAll = False, addedCat = None):
+ def __init__(self, generator, templates, subst=False, remove=False,
+ editSummary='', acceptAll=False, addedCat=None):
"""
Arguments:
* generator - A page generator.
@@ -201,6 +205,7 @@
removed/resolved to None.
* remove - True if the template should be removed.
* subst - True if the template should be resolved.
+
"""
self.generator = generator
self.templates = templates
@@ -217,7 +222,7 @@
comma = self.summary = site.mediawiki_message('comma-separator')
# get edit summary message if it's empty
- if (self.editSummary==''):
+ if not self.editSummary:
Param = {'list': comma.join(self.templates.keys()),
'num' : len(self.templates)}
if self.remove:
@@ -231,9 +236,7 @@
site, 'template-changing', Param)
def run(self):
- """
- Starts the robot's action.
- """
+ """Starts the robot's action."""
# regular expression to find the original template.
# {{vfd}} does the same thing as {{Vfd}}, so both will be found.
# The old syntax, {{msg:vfd}}, will also be found.
@@ -277,6 +280,7 @@
addedCat=self.addedCat,
editSummary=self.editSummary)
replaceBot.run()
+
def main(*args):
templateNames = []
@@ -355,7 +359,7 @@
for t in oldTemplates]
gen = pg.CombinedPageGenerator(gens)
gen = pg.DuplicateFilterPageGenerator(gen)
-
+
preloadingGen = pg.PreloadingGenerator(gen)
bot = TemplateRobot(preloadingGen, templates, subst, remove, editSummary,
acceptAll, addedCat)
--
To view, visit https://gerrit.wikimedia.org/r/78674
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I4cf67a6b69a0a34b5dd2ebf9ef21904b6c3af563
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/compat
Gerrit-Branch: master
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: Legoktm <legoktm.wikipedia(a)gmail.com>
Gerrit-Reviewer: jenkins-bot
Xqt has submitted this change and it was merged.
Change subject: update mw version to 1.22wmf12
......................................................................
update mw version to 1.22wmf12
Change-Id: Id872c2a66c9812cbb244c896d42c22b1cad39ef1
---
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 68f136e..dcd04dc 100644
--- a/pywikibot/family.py
+++ b/pywikibot/family.py
@@ -937,7 +937,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.22wmf10'
+ return '1.22wmf12'
def shared_image_repository(self, code):
return ('commons', 'commons')
--
To view, visit https://gerrit.wikimedia.org/r/78905
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Id872c2a66c9812cbb244c896d42c22b1cad39ef1
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: update language_by_size from combat (gerrit:78656)
......................................................................
update language_by_size from combat (gerrit:78656)
Change-Id: I557b394aa2acb63f163f0d27f9355cbbdff42eee
---
M LICENSE
1 file changed, 1 insertion(+), 1 deletion(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/LICENSE b/LICENSE
index 5b7c951..6011a07 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,4 +1,4 @@
-Copyright (c) 2004-2012 Pywikipedia bot team
+Copyright (c) 2004-2013 Pywikipedia bot team
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
--
To view, visit https://gerrit.wikimedia.org/r/78787
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I557b394aa2acb63f163f0d27f9355cbbdff42eee
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: Legoktm <legoktm.wikipedia(a)gmail.com>
Gerrit-Reviewer: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot
Merlijn van Deen has submitted this change and it was merged.
Change subject: - Indent option documentation - actualize (c) line - remove out-commented localisations - some pep8 changes
......................................................................
- Indent option documentation
- actualize (c) line
- remove out-commented localisations
- some pep8 changes
Change-Id: I4f9bef944a3c0558a00a32244b4efa0f95269d77
---
M misspelling.py
1 file changed, 17 insertions(+), 14 deletions(-)
Approvals:
Merlijn van Deen: Looks good to me, approved
jenkins-bot: Verified
diff --git a/misspelling.py b/misspelling.py
index be5d76d..8c891c3 100644
--- a/misspelling.py
+++ b/misspelling.py
@@ -12,7 +12,7 @@
some choices for XY don't make sense and will result in a loop,
e.g. "l" or "m".
- -start:XY goes through all misspellings in the category on your wiki
+ -start:XY goes through all misspellings in the category on your wiki
that is defined (to the bot) as the category containing
misspelling pages, starting at XY. If the -start argument is not
given, it starts at the beginning.
@@ -23,34 +23,34 @@
__version__ = '$Id$'
# (C) Daniel Herding, 2007
+# (C) Pywikipedia bot team 2007-2013
#
# Distributed under the terms of the MIT license.
import wikipedia as pywikibot
-import catlib, pagegenerators
+import catlib
+import pagegenerators as pg
import solve_disambiguation
+
class MisspellingRobot(solve_disambiguation.DisambiguationRobot):
misspellingTemplate = {
'da': None, # uses simple redirects
'de': u'Falschschreibung',
- #'en': u'Template:Misspelling', # rarely used on en:
'en': None, # uses simple redirects
'hu': None, # uses simple redirects
'nl': None,
- #'pt': u'Pseudo-redirect', # replaced by another system on pt:
}
# Optional: if there is a category, one can use the -start
# parameter.
misspellingCategory = {
- 'da': u'Omdirigeringer af fejlstavninger', # only contains date redirects at the moment
+ 'da': u'Omdirigeringer af fejlstavninger', # only contains date redirects at the moment
'de': u'Kategorie:Wikipedia:Falschschreibung',
'en': u'Redirects from misspellings',
'hu': u'Átirányítások hibás névről',
'nl': u'Categorie:Wikipedia:Redirect voor spelfout',
- #'pt': u'Categoria:!Pseudo-redirects',
}
msg = {
@@ -67,7 +67,8 @@
def __init__(self, always, firstPageTitle, main_only):
solve_disambiguation.DisambiguationRobot.__init__(
- self, always, [], True, False, self.createPageGenerator(firstPageTitle),
+ self, always, [], True, False,
+ self.createPageGenerator(firstPageTitle),
False, main_only)
def createPageGenerator(self, firstPageTitle):
@@ -75,19 +76,20 @@
misspellingCategoryTitle = self.misspellingCategory[pywikibot.getSite().lang]
misspellingCategory = catlib.Category(pywikibot.getSite(),
misspellingCategoryTitle)
- generator = pagegenerators.CategorizedPageGenerator(
- misspellingCategory, recurse = True, start=firstPageTitle)
+ generator = pg.CategorizedPageGenerator(misspellingCategory,
+ recurse=True,
+ start=firstPageTitle)
else:
misspellingTemplateName = 'Template:%s' \
% self.misspellingTemplate[pywikibot.getSite().lang]
misspellingTemplate = pywikibot.Page(pywikibot.getSite(),
misspellingTemplateName)
- generator = pagegenerators.ReferringPageGenerator(
- misspellingTemplate, onlyTemplateInclusion=True)
+ generator = pg.ReferringPageGenerator(misspellingTemplate,
+ onlyTemplateInclusion=True)
if firstPageTitle:
pywikibot.output(
u'-start parameter unsupported on this wiki because there is no category for misspellings.')
- preloadingGen = pagegenerators.PreloadingGenerator(generator)
+ preloadingGen = pg.PreloadingGenerator(generator)
return preloadingGen
# Overrides the DisambiguationRobot method.
@@ -113,12 +115,14 @@
return True
# Overrides the DisambiguationRobot method.
- def setSummaryMessage(self, disambPage, new_targets=[], unlink=False, dn=False):
+ def setSummaryMessage(self, disambPage, new_targets=[], unlink=False,
+ dn=False):
# TODO: setSummaryMessage() in solve_disambiguation now has parameters
# new_targets and unlink. Make use of these here.
comment = pywikibot.translate(self.mysite, self.msg) \
% disambPage.title()
pywikibot.setAction(comment)
+
def main():
# the option that's always selected when the bot wonders what to do with
@@ -138,7 +142,6 @@
firstPageTitle = arg[7:]
elif arg == '-main':
main_only = True
-
bot = MisspellingRobot(always, firstPageTitle, main_only)
bot.run()
--
To view, visit https://gerrit.wikimedia.org/r/78659
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I4f9bef944a3c0558a00a32244b4efa0f95269d77
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/compat
Gerrit-Branch: master
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: Legoktm <legoktm.wikipedia(a)gmail.com>
Gerrit-Reviewer: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: jenkins-bot
Xqt has submitted this change and it was merged.
Change subject: Actualize year
......................................................................
Actualize year
Change-Id: Ib7e119a307e7468e441a1640593f51a6d43a0ad6
---
M LICENSE
1 file changed, 1 insertion(+), 1 deletion(-)
Approvals:
Xqt: Verified; Looks good to me, approved
diff --git a/LICENSE b/LICENSE
index 95545e7..a3fd6e8 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,4 +1,4 @@
-Copyright (c) 2004-2012 Pywikipedia bot team
+Copyright (c) 2004-2013 Pywikipedia bot team
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
--
To view, visit https://gerrit.wikimedia.org/r/78657
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ib7e119a307e7468e441a1640593f51a6d43a0ad6
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/compat
Gerrit-Branch: master
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Xqt <info(a)gno.de>