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>
jenkins-bot has submitted this change and it was merged.
Change subject: Converted (to .md) & updated readme file
......................................................................
Converted (to .md) & updated readme file
Added TravisCI build status badge
Change-Id: Ie0e3e2cc82ed9ff118801de51a6fdcb5682b38d4
---
R README.md
1 file changed, 4 insertions(+), 0 deletions(-)
Approvals:
Merlijn van Deen: Looks good to me, approved
jenkins-bot: Verified
diff --git a/README b/README.md
similarity index 64%
rename from README
rename to README.md
index 8ae4e49..3592013 100644
--- a/README
+++ b/README.md
@@ -1,3 +1,7 @@
+# Python Wikipedia Robot Framework
+
+[![Build Status](https://secure.travis-ci.org/wikimedia/pywikibot-core.png?branch=ma…
+
This is the rewrite of the Python Wikipedia Robot Framework. It features several
improvements, such as full API usage and a pythonic package layout.
--
To view, visit https://gerrit.wikimedia.org/r/78487
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ie0e3e2cc82ed9ff118801de51a6fdcb5682b38d4
Gerrit-PatchSet: 3
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw <jeroendedauw(a)gmail.com>
Gerrit-Reviewer: DrTrigon <dr.trigon(a)surfeu.ch>
Gerrit-Reviewer: Jeroen De Dauw <jeroendedauw(a)gmail.com>
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
Merlijn van Deen has submitted this change and it was merged.
Change subject: Disable printing of API parameters which could leak private info and were generally not useful
......................................................................
Disable printing of API parameters which could leak private info and were generally not useful
Change-Id: I8a8a8d10799df4f61e4465fe60b6c7efbefbd962
---
M tests/__init__.py
1 file changed, 0 insertions(+), 7 deletions(-)
Approvals:
Merlijn van Deen: Looks good to me, approved
diff --git a/tests/__init__.py b/tests/__init__.py
index 0487fc4..e0c4f27 100644
--- a/tests/__init__.py
+++ b/tests/__init__.py
@@ -24,13 +24,6 @@
def _expired(self, dt):
return False
- def submit(self):
- cached_available = self._load_cache()
- if not cached_available:
- print str(self)
- return super(TestRequest, self).submit()
-
-
def patch_request():
pywikibot.data.api.Request = TestRequest
--
To view, visit https://gerrit.wikimedia.org/r/78542
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I8a8a8d10799df4f61e4465fe60b6c7efbefbd962
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Legoktm <legoktm.wikipedia(a)gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: jenkins-bot