jenkins-bot has submitted this change and it was merged.
Change subject: Customizable CFD working page location.
......................................................................
Customizable CFD working page location.
Change-Id: I70be91075ff7c9e439e5a11b9adede1d3215164c
---
M cfd.py
1 file changed, 11 insertions(+), 5 deletions(-)
Approvals:
Ladsgroup: Looks good to me, approved
jenkins-bot: Verified
diff --git a/cfd.py b/cfd.py
index 17d77c5..0cf0c09 100644
--- a/cfd.py
+++ b/cfd.py
@@ -17,9 +17,6 @@
import re
import category
-# The location of the CFD working page.
-cfdPage = 'Wikipedia:Categories for discussion/Working'
-
# A list of templates that are used on category pages as part of the CFD
# process that contain information such as the link to the per-day discussion
# page.
@@ -60,8 +57,17 @@
return self.result
-def main():
- pywikibot.handleArgs()
+def main(*args):
+ # The location of the CFD working page.
+ cfdPage = 'Wikipedia:Categories for discussion/Working'
+ for arg in pywikibot.handleArgs(*args):
+ # Use a non-default CFD working page if one is specified from the command-line using -page.
+ if arg.startswith('-page'):
+ if len(arg) == len('-page'):
+ cfdPage = pywikibot.input(
+ u'Enter the CFD working page to use:')
+ else:
+ cfdPage = arg[len('-page:'):].replace('_', ' ')
page = pywikibot.Page(pywikibot.getSite(), cfdPage)
--
To view, visit https://gerrit.wikimedia.org/r/122118
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I70be91075ff7c9e439e5a11b9adede1d3215164c
Gerrit-PatchSet: 2
Gerrit-Project: pywikibot/compat
Gerrit-Branch: master
Gerrit-Owner: Cyde <cydeweys(a)gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: jenkins-bot <>
jenkins-bot has submitted this change and it was merged.
Change subject: update date + fix typos
......................................................................
update date + fix typos
Change-Id: I218407187fc2fbdd5906a9c38737a99ce4986956
---
M LICENSE
1 file changed, 3 insertions(+), 3 deletions(-)
Approvals:
Mpaa: Looks good to me, approved
jenkins-bot: Verified
diff --git a/LICENSE b/LICENSE
index 1b1e522..cc87fc4 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,4 +1,4 @@
-Copyright (c) 2004-2013 Pywikibot team
+Copyright (c) 2004-2014 Pywikibot team
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
@@ -21,7 +21,7 @@
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
-Everything in the 'externals' directory is general released under seperate
+Everything in the 'externals' directory is general released under separate
licenses. Some parts may come from Pywikibot team and share the same
permissions, but in general they have to be checked for any external package
-seperately.
+separately.
--
To view, visit https://gerrit.wikimedia.org/r/121116
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I218407187fc2fbdd5906a9c38737a99ce4986956
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Mpaa <mpaa.wiki(a)gmail.com>
Gerrit-Reviewer: Mpaa <mpaa.wiki(a)gmail.com>
Gerrit-Reviewer: jenkins-bot <>
jenkins-bot has submitted this change and it was merged.
Change subject: backward compatibility with compat
......................................................................
backward compatibility with compat
- mark "number" as deprecated for pg.NewimagesPageGenerator
- NamespaceFilterPageGenerator may have a single item as namespaces
Change-Id: Ib4090d07cce977c7bfe8baa4878f12b10766af20
---
M pywikibot/pagegenerators.py
1 file changed, 3 insertions(+), 0 deletions(-)
Approvals:
Merlijn van Deen: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/pagegenerators.py b/pywikibot/pagegenerators.py
index b7bf132..959e3fc 100644
--- a/pywikibot/pagegenerators.py
+++ b/pywikibot/pagegenerators.py
@@ -767,6 +767,8 @@
"""
if site is None:
site = pywikibot.Site()
+ if isinstance(namespaces, (int, basestring)):
+ namespaces = [namespaces]
# convert namespace names to namespace numbers
for i in range(len(namespaces)):
ns = namespaces[i]
@@ -897,6 +899,7 @@
yield i
+@deprecate_arg("number", "total")
def NewimagesPageGenerator(step=None, total=None, site=None):
if site is None:
site = pywikibot.Site()
--
To view, visit https://gerrit.wikimedia.org/r/120388
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ib4090d07cce977c7bfe8baa4878f12b10766af20
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: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: jenkins-bot <>
jenkins-bot has submitted this change and it was merged.
Change subject: Enable just purging a page instead of touch it.
......................................................................
Enable just purging a page instead of touch it.
- new option -purge to purch the server's cache
- derive the bot from pywikibot.Bot class
- pyflake: remove obsolete "import config"
Change-Id: I5211f57fd521671bd0ec9752ec44e4a560dd91d2
---
M scripts/touch.py
1 file changed, 23 insertions(+), 10 deletions(-)
Approvals:
Merlijn van Deen: Looks good to me, approved
jenkins-bot: Verified
diff --git a/scripts/touch.py b/scripts/touch.py
index 86571b8..228703e 100755
--- a/scripts/touch.py
+++ b/scripts/touch.py
@@ -10,7 +10,9 @@
¶ms;
--redir specifies that the robot should touch redirect pages;
+-purge Do not touch but purge the page
+
+-redir specifies that the robot should work on redirect pages;
otherwise, they will be skipped.
All other parameters will be regarded as a page title; in this case, the bot
@@ -25,23 +27,34 @@
#
import pywikibot
-from pywikibot import pagegenerators, config
+from pywikibot import pagegenerators
docuReplacements = {'¶ms;': pagegenerators.parameterHelp}
-class TouchBot:
- def __init__(self, generator, touch_redirects):
+class TouchBot(pywikibot.Bot):
+
+ def __init__(self, generator, **kwargs):
+ self.availableOptions.update({
+ 'redir': False, # include redirect pages
+ 'purge': False, # purge only
+ })
+
+ super(TouchBot, self).__init__(**kwargs)
self.generator = generator
- self.touch_redirects = touch_redirects
def run(self):
for page in self.generator:
+ if self.getOption('purge'):
+ pywikibot.output(u'Page %s%s purged'
+ % (page.title(asLink=True),
+ "" if page.purge() else " not"))
+ continue
try:
# get the page, and save it using the unmodified text.
# whether or not getting a redirect throws an exception
# depends on the variable self.touch_redirects.
- page.get(get_redirect=self.touch_redirects)
+ page.get(get_redirect=self.getOption('redir'))
page.save("Pywikibot touch script")
except pywikibot.NoPage:
pywikibot.error(u"Page %s does not exist."
@@ -60,7 +73,7 @@
def main(*args):
gen = None
genFactory = pagegenerators.GeneratorFactory()
- redirs = False
+ options = {}
# If the user chooses to work on a single page, this temporary array is
# used to read the words from the page title. The words will later be
# joined with spaces to retrieve the full title.
@@ -68,8 +81,8 @@
for arg in pywikibot.handleArgs(*args):
if genFactory.handleArg(arg):
continue
- if arg == '-redir':
- redirs = True
+ if arg.startswith("-"):
+ options[arg[1:].lower()] = True
else:
pageTitle.append(arg)
pywikibot.Site().login()
@@ -83,7 +96,7 @@
pywikibot.showHelp()
return
preloadingGen = pagegenerators.PreloadingGenerator(gen)
- bot = TouchBot(preloadingGen, redirs)
+ bot = TouchBot(preloadingGen, **options)
bot.run()
--
To view, visit https://gerrit.wikimedia.org/r/120373
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I5211f57fd521671bd0ec9752ec44e4a560dd91d2
Gerrit-PatchSet: 3
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: Pyfisch <pyfisch(a)gmail.com>
Gerrit-Reviewer: Ricordisamoa <ricordisamoa(a)live.it>
Gerrit-Reviewer: Russell Blau <russblau(a)imapmail.org>
Gerrit-Reviewer: jenkins-bot <>