jenkins-bot has submitted this change. (
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/637741 )
Change subject: [IMPR] Rewrite scripts using new option handler
......................................................................
[IMPR] Rewrite scripts using new option handler
Bug: T264721
Change-Id: I0023514519c375383a1a9c262cf804cb02574f05
---
M scripts/capitalize_redirects.py
M scripts/claimit.py
M scripts/clean_sandbox.py
M scripts/commons_link.py
M scripts/coordinate_import.py
M scripts/cosmetic_changes.py
M scripts/create_categories.py
M scripts/harvest_template.py
M scripts/image.py
M scripts/isbn.py
M scripts/makecat.py
M scripts/nowcommons.py
M scripts/pagefromfile.py
M scripts/patrol.py
M scripts/piper.py
15 files changed, 101 insertions(+), 109 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/scripts/capitalize_redirects.py b/scripts/capitalize_redirects.py
index 601759d..039e6c5 100755
--- a/scripts/capitalize_redirects.py
+++ b/scripts/capitalize_redirects.py
@@ -56,7 +56,7 @@
@kwarg titlecase: create a titlecased redirect page instead a
capitalized one.
"""
- self.availableOptions.update({
+ self.available_options.update({
'titlecase': False,
})
@@ -66,7 +66,7 @@
"""Capitalize redirects of the current page."""
page_t = self.current_page.title()
site = self.current_page.site
- if self.getOption('titlecase'):
+ if self.opt.titlecase:
page_cap = pywikibot.Page(site, page_t.title())
else:
page_cap = pywikibot.Page(site, page_t.capitalize())
diff --git a/scripts/claimit.py b/scripts/claimit.py
index 0cdfda0..6825d17 100755
--- a/scripts/claimit.py
+++ b/scripts/claimit.py
@@ -76,7 +76,7 @@
@param exists_arg: String specifying how to handle duplicate claims
@type exists_arg: str
"""
- self.availableOptions['always'] = True
+ self.available_options['always'] = True
super().__init__()
self.generator = generator
self.claims = claims
diff --git a/scripts/clean_sandbox.py b/scripts/clean_sandbox.py
index 44166a9..438573b 100755
--- a/scripts/clean_sandbox.py
+++ b/scripts/clean_sandbox.py
@@ -148,7 +148,7 @@
"""Sandbox reset bot."""
- availableOptions = {
+ available_options = {
'hours': 1.0,
'no_repeat': True,
'delay': -1,
@@ -160,15 +160,15 @@
def __init__(self, **kwargs) -> None:
"""Initializer."""
super().__init__(**kwargs)
- if self.getOption('delay') < 0:
- d = min(15, max(5, int(self.getOption('hours') * 60)))
- self.availableOptions['delay_td'] = datetime.timedelta(minutes=d)
+ if self.opt.delay < 0:
+ d = min(15, max(5, int(self.opt.hours * 60)))
+ self.available_options['delay_td'] = datetime.timedelta(minutes=d)
else:
- d = max(5, self.getOption('delay'))
- self.availableOptions['delay_td'] = datetime.timedelta(minutes=d)
+ d = max(5, self.opt.delay)
+ self.available_options['delay_td'] = datetime.timedelta(minutes=d)
self.site = pywikibot.Site()
- self.translated_content = self.getOption('text') or i18n.translate(
+ self.translated_content = self.opt.text or i18n.translate(
self.site, content)
if not self.translated_content:
raise RuntimeError(
@@ -199,8 +199,8 @@
.format(sandbox_page.title(as_link=True)))
try:
text = sandbox_page.text
- if self.getOption('summary'):
- translated_msg = self.getOption('summary')
+ if self.opt.summary:
+ translated_msg = self.opt.summary
else:
translated_msg = i18n.twtranslate(
self.site, 'clean_sandbox-cleaned')
@@ -221,7 +221,7 @@
else:
edit_delta = (datetime.datetime.utcnow()
- sandbox_page.editTime())
- delta = self.getOption('delay_td') - edit_delta
+ delta = self.opt.delay_td - edit_delta
# Is the last edit more than 'delay' minutes ago?
if delta <= datetime.timedelta(0):
sandbox_page.put(
@@ -244,17 +244,17 @@
pywikibot.output(
'*** The sandbox is not existent, skipping.')
continue
- if self.getOption('no_repeat'):
+ if self.opt.no_repeat:
pywikibot.output('\nDone.')
return
elif not wait:
- if self.getOption('hours') < 1.0:
+ if self.opt.hours < 1.0:
pywikibot.output('\nSleeping {} minutes, now {}'.format(
- (self.getOption('hours') * 60), now))
+ (self.opt.hours * 60), now))
else:
pywikibot.output('\nSleeping {} hours, now {}'
- .format(self.getOption('hours'), now))
- pywikibot.sleep(self.getOption('hours') * 60 * 60)
+ .format(self.opt.hours, now))
+ pywikibot.sleep(self.opt.hours * 60 * 60)
def main(*args: Tuple[str, ...]) -> None:
diff --git a/scripts/commons_link.py b/scripts/commons_link.py
index 495025e..714f400 100755
--- a/scripts/commons_link.py
+++ b/scripts/commons_link.py
@@ -48,7 +48,7 @@
def __init__(self, generator, **kwargs):
"""Initializer."""
- self.availableOptions.update({
+ self.available_options.update({
'action': None,
})
super(CommonsLinkBot, self).__init__(**kwargs)
@@ -60,9 +60,9 @@
def run(self):
"""Run the bot."""
- if not all((self.getOption('action'), self.generator)):
+ if not all((self.opt.action, self.generator)):
return
- catmode = (self.getOption('action') == 'categories')
+ catmode = (self.opt.action == 'categories')
for page in self.generator:
try:
self.current_page = page
diff --git a/scripts/coordinate_import.py b/scripts/coordinate_import.py
index 754410d..acb05f3 100755
--- a/scripts/coordinate_import.py
+++ b/scripts/coordinate_import.py
@@ -62,12 +62,12 @@
@param generator: A generator that yields Page objects.
"""
- self.availableOptions['create'] = False
+ self.available_options['create'] = False
super().__init__(**kwargs)
self.generator = generator
self.cacheSources()
self.prop = 'P625'
- self.create_missing_item = self.getOption('create')
+ self.create_missing_item = self.opt.create
def has_coord_qualifier(self, claims) -> Optional[str]:
"""
diff --git a/scripts/cosmetic_changes.py b/scripts/cosmetic_changes.py
index 42b5b60..220fa01 100644
--- a/scripts/cosmetic_changes.py
+++ b/scripts/cosmetic_changes.py
@@ -58,7 +58,7 @@
def __init__(self, generator, **kwargs) -> None:
"""Initializer."""
- self.availableOptions.update({
+ self.available_options.update({
'async': False,
'summary': 'Robot: Cosmetic changes',
'ignore': cosmetic_changes.CANCEL_ALL,
@@ -70,12 +70,12 @@
def treat_page(self) -> None:
"""Treat page with the cosmetic toolkit."""
cc_toolkit = cosmetic_changes.CosmeticChangesToolkit.from_page(
- self.current_page, ignore=self.getOption('ignore'))
+ self.current_page, ignore=self.opt.ignore)
changed_text = cc_toolkit.change(self.current_page.get())
if changed_text is not False:
self.put_current(new_text=changed_text,
- summary=self.getOption('summary'),
- asynchronous=self.getOption('async'))
+ summary=self.opt.summary,
+ asynchronous=self.opt['async'])
def main(*args: Tuple[str, ...]) -> None:
diff --git a/scripts/create_categories.py b/scripts/create_categories.py
index 144494c..5e85086 100755
--- a/scripts/create_categories.py
+++ b/scripts/create_categories.py
@@ -51,7 +51,7 @@
def __init__(self, **kwargs):
"""Initializer."""
- self.availableOptions.update({
+ self.available_options.update({
'basename': None,
'parent': None,
'overwrite': False,
@@ -67,11 +67,11 @@
return title
category = pywikibot.Category(
- page.site, '{} {}'.format(self.getOption('basename'),
title))
+ page.site, '{} {}'.format(self.opt.basename, title))
text = '[[{namespace}:{parent}|{title}]]\n{category}\n'.format(
namespace=page.site.namespace(Namespace.CATEGORY),
- parent=self.getOption('parent'),
+ parent=self.opt.parent,
title=title,
category=page)
category.text = text
@@ -88,7 +88,7 @@
if isinstance(page, str):
pywikibot.warning(page + ' is not a category, skipping')
return True
- if page.exists() and not self.getOption('overwrite'):
+ if page.exists() and not self.opt.overwrite:
pywikibot.warning('{} already exists, skipping'.format(page))
return True
return super().skip_page(page)
diff --git a/scripts/harvest_template.py b/scripts/harvest_template.py
index 9f0d587..92d4481 100755
--- a/scripts/harvest_template.py
+++ b/scripts/harvest_template.py
@@ -124,7 +124,7 @@
"""Class holding options for a param-property pair."""
- availableOptions = {
+ available_options = {
'exists': '',
'islink': False,
'multi': False,
@@ -156,7 +156,7 @@
single parameter
@type multi: bool
"""
- self.availableOptions.update({
+ self.available_options.update({
'always': True,
'create': False,
'exists': '',
@@ -176,7 +176,7 @@
template_title = template_title.replace('_', ' ')
self.templateTitles = self.getTemplateSynonyms(template_title)
self.linkR = textlib.compileLinkR()
- self.create_missing_item = self.getOption('create')
+ self.create_missing_item = self.opt.create
def getTemplateSynonyms(self, title) -> List[str]:
"""Fetch redirects of the title, so we can check against
them."""
@@ -239,7 +239,7 @@
@see: L{OptionHandler.getOption}
"""
- default = self.getOption(option)
+ default = self.opt.option
local = handler.getOption(option)
if isinstance(default, bool) and isinstance(local, bool):
return default is not local
diff --git a/scripts/image.py b/scripts/image.py
index 75460f8..7be7ab9 100755
--- a/scripts/image.py
+++ b/scripts/image.py
@@ -71,7 +71,7 @@
None if you want to remove the image
@type new_image: str or None
"""
- self.availableOptions.update({
+ self.available_options.update({
'summary': None,
'loose': False,
})
@@ -86,7 +86,7 @@
'file': self.old_image,
}
- summary = self.getOption('summary') or i18n.twtranslate(
+ summary = self.opt.summary or i18n.twtranslate(
self.site, 'image-replace' if self.new_image else
'image-remove',
param)
@@ -100,7 +100,7 @@
# Be careful, spaces and _ have been converted to '\ ' and '\_'
escaped = re.sub('\\\\[_ ]', '[_ ]', escaped)
- if not self.getOption('loose') or not self.new_image:
+ if not self.opt.loose or not self.new_image:
image_regex = re.compile(
r'\[\[ *(?:%s)\s*:\s*%s *(?P<parameters>\|[^\n]+|) *\]\]'
% ('|'.join(namespace), escaped))
@@ -109,7 +109,7 @@
replacements = []
if self.new_image:
- if not self.getOption('loose'):
+ if not self.opt.loose:
replacements.append((image_regex,
'[[{}:{}\\g<parameters>]]'
.format(
@@ -121,7 +121,7 @@
replacements.append((image_regex, ''))
super(ImageRobot, self).__init__(self.generator, replacements,
- always=self.getOption('always'),
+ always=self.opt.always,
site=self.site,
summary=summary)
diff --git a/scripts/isbn.py b/scripts/isbn.py
index d7190e7..26c3c58 100755
--- a/scripts/isbn.py
+++ b/scripts/isbn.py
@@ -159,15 +159,14 @@
"""ISBN bot."""
- def __init__(self, generator, **kwargs):
+ def __init__(self, **kwargs):
"""Initializer."""
- self.availableOptions.update({
+ self.available_options.update({
'to13': False,
'format': False,
})
super().__init__(**kwargs)
- self.generator = generator
self.isbnR = re.compile(r'(?<=ISBN )(?P<code>[\d\-]+[Xx]?)')
self.comment = i18n.twtranslate(self.site, 'isbn-formatting')
@@ -183,10 +182,10 @@
pywikibot.output(e)
new_text = old_text
- if self.getOption('to13'):
+ if self.opt.to13:
new_text = self.isbnR.sub(_isbn10toIsbn13, new_text)
- if self.getOption('format'):
+ if self.opt.format:
new_text = self.isbnR.sub(_hyphenateIsbnNumber, new_text)
try:
self.userPut(page, page.text, new_text, summary=self.comment)
@@ -214,9 +213,9 @@
use_from_page = None
- def __init__(self, generator, **kwargs):
+ def __init__(self, **kwargs):
"""Initializer."""
- self.availableOptions.update({
+ self.available_options.update({
'to13': False,
'format': False,
})
@@ -225,7 +224,6 @@
super().__init__(**kwargs)
- self.generator = generator
if self.isbn_10_prop_id is None:
self.isbn_10_prop_id = self.get_property_by_name('ISBN-10')
if self.isbn_13_prop_id is None:
@@ -247,10 +245,10 @@
old_isbn = 'ISBN ' + isbn
- if self.getOption('format'):
+ if self.opt.format:
new_isbn = hyphenateIsbnNumbers(old_isbn)
- if self.getOption('to13'):
+ if self.opt.to13:
new_isbn = convertIsbn10toIsbn13(old_isbn)
item.claims[claim.getID()].remove(claim)
@@ -279,7 +277,7 @@
new_isbn))
# -format is the only option that has any effect on ISBN13
- if self.getOption('format') and self.isbn_13_prop_id in item.claims:
+ if self.opt.format and self.isbn_13_prop_id in item.claims:
for claim in item.claims[self.isbn_13_prop_id]:
isbn = claim.getTarget()
try:
@@ -347,9 +345,9 @@
return
if use_wikibase:
- bot = IsbnWikibaseBot(gen, **options)
+ bot = IsbnWikibaseBot(generator=gen, **options)
else:
- bot = IsbnBot(gen, **options)
+ bot = IsbnBot(generator=gen, **options)
bot.run()
diff --git a/scripts/makecat.py b/scripts/makecat.py
index 1c14f0c..2acecac 100755
--- a/scripts/makecat.py
+++ b/scripts/makecat.py
@@ -63,7 +63,7 @@
def __init__(self, **kwargs):
"""Initializer."""
- self.availableOptions.update({
+ self.available_options.update({
'all': False,
'exist': False,
'forward': False,
@@ -71,13 +71,13 @@
'nodate': False,
})
super(MakeCatBot, self).__init__(**kwargs)
- self.skipdates = self.getOption('nodate')
+ self.skipdates = self.opt.nodate
self.checkforward = True
- self.checkbackward = not self.getOption('forward')
- self.checkbroken = not (self.getOption('forward')
- and self.getOption('exist'))
- self.removeparent = not self.getOption('keepparent')
- self.main = not self.getOption('all')
+ self.checkbackward = not self.opt.forward
+ self.checkbroken = not (self.opt.forward
+ and self.opt.exist)
+ self.removeparent = not self.opt.keepparent
+ self.main = not self.opt.all
def needcheck(self, page):
"""Verify whether the current page may be
processed."""
diff --git a/scripts/nowcommons.py b/scripts/nowcommons.py
index 79c5135..2aa9da9 100755
--- a/scripts/nowcommons.py
+++ b/scripts/nowcommons.py
@@ -181,7 +181,7 @@
def __init__(self, **kwargs):
"""Initializer."""
- self.availableOptions.update({
+ self.available_options.update({
'replace': False,
'replacealways': False,
'replaceloose': False,
@@ -284,7 +284,7 @@
'is still used in {1} pages.',
localImagePage.title(with_ns=False),
len(usingPages)))
- if self.getOption('replace') is True:
+ if self.opt.replace is True:
pywikibot.output(color_format(
'Replacing "{lightred}{0}{default}" by
'
'"{lightgreen}{1}{default}\".',
@@ -294,23 +294,23 @@
pg.FileLinksGenerator(localImagePage),
localImagePage.title(with_ns=False),
commonsImagePage.title(with_ns=False),
- '', self.getOption('replacealways'),
- self.getOption('replaceloose'))
+ '', self.opt.replacealways,
+ self.opt.replaceloose)
bot.run()
# If the image is used with the urlname the
# previous function won't work
is_used = bool(list(pywikibot.FilePage(
self.site,
page.title()).usingPages(total=1)))
- if is_used and self.getOption('replaceloose'):
+ if is_used and self.opt.replaceloose:
bot = ImageBot(
pg.FileLinksGenerator(
localImagePage),
localImagePage.title(
with_ns=False, as_url=True),
commonsImagePage.title(with_ns=False),
- '', self.getOption('replacealways'),
- self.getOption('replaceloose'))
+ '', self.opt.replacealways,
+ self.opt.replaceloose)
bot.run()
# refresh because we want the updated list
usingPages = len(list(pywikibot.FilePage(
@@ -325,7 +325,7 @@
'anymore.',
localImagePage.title(with_ns=False)))
commonsText = commonsImagePage.get()
- if self.getOption('replaceonly') is False:
+ if self.opt.replaceonly is False:
if sha1 == commonsImagePage.latest_file_info.sha1:
pywikibot.output(
'The image is identical to the one on Commons.')
@@ -335,7 +335,7 @@
'delete it manually after making sure that '
'the old versions are not worth keeping.')
continue
- if self.getOption('always') is False:
+ if self.opt.always is False:
format_str = color_format(
'\n\n>>>> Description on
{lightpurple}%s'
'{default} <<<<\n')
diff --git a/scripts/pagefromfile.py b/scripts/pagefromfile.py
index de480d8..726225f 100755
--- a/scripts/pagefromfile.py
+++ b/scripts/pagefromfile.py
@@ -97,7 +97,7 @@
def __init__(self, **kwargs) -> None:
"""Initializer."""
- self.availableOptions.update({
+ self.available_options.update({
'always': True,
'force': False,
'append': None,
@@ -110,8 +110,8 @@
})
super().__init__(**kwargs)
- self.availableOptions.update(
- {'always': not self.getOption('showdiff')})
+ self.available_options.update(
+ {'always': not self.opt.showdiff})
def init_page(self, item) -> pywikibot.Page:
"""Get the tuple and return the page object to be
processed."""
@@ -129,8 +129,8 @@
# delete page's text to get it from live wiki
del page.text
- if self.getOption('summary'):
- comment = self.getOption('summary')
+ if self.opt.summary:
+ comment = self.opt.summary
else:
comment = i18n.twtranslate(self.site, 'pagefromfile-msg')
@@ -142,32 +142,32 @@
comment, i18n.twtranslate(self.site, 'pagefromfile-msg_force'))
if page.exists():
- if not self.getOption('redirect') and page.isRedirectPage():
+ if not self.opt.redirect and page.isRedirectPage():
pywikibot.output('Page {0} is redirect, skipping!'
.format(title))
return
pagecontents = page.text
- nocontent = self.getOption('nocontent')
+ nocontent = self.opt.nocontent
if (nocontent
and (nocontent in pagecontents
or nocontent.lower() in pagecontents)):
pywikibot.output('Page has {0} so it is skipped'
.format(nocontent))
return
- if self.getOption('append'):
- separator = self.getOption('append')[1]
+ if self.opt.append:
+ separator = self.opt.append[1]
if separator == r'\n':
separator = '\n'
- if self.getOption('append')[0] == 'top':
+ if self.opt.append[0] == 'top':
above, below = contents, pagecontents
comment = comment_top
else:
above, below = pagecontents, contents
comment = comment_bottom
pywikibot.output('Page {0} already exists, appending on {1}!'
- .format(title, self.getOption('append')[0]))
+ .format(title, self.opt.append[0]))
contents = above + separator + below
- elif self.getOption('force'):
+ elif self.opt.force:
pywikibot.output('Page {0} already exists, ***overwriting!'
.format(title))
comment = comment_force
@@ -176,12 +176,12 @@
.format(title))
return
else:
- if self.getOption('autosummary'):
+ if self.opt.autosummary:
comment = config.default_edit_summary = ''
self.put_current(contents, summary=comment,
- minor=self.getOption('minor'),
- show_diff=self.getOption('showdiff'))
+ minor=self.opt.minor,
+ show_diff=self.opt.showdiff)
class PageFromFileReader(OptionHandler):
@@ -193,7 +193,7 @@
# should be included and does not occur elsewhere in the text.
# TODO: make config variables for these.
- availableOptions = {
+ available_options = {
'begin': '{{-start-}}',
'end': '{{-stop-}}',
'titlestart': "'''",
@@ -213,12 +213,6 @@
"""
super().__init__(**kwargs)
self.filename = filename
- self.pageStartMarker = self.getOption('begin')
- self.pageEndMarker = self.getOption('end')
- self.titleStartMarker = self.getOption('titlestart')
- self.titleEndMarker = self.getOption('titleend')
- self.include = self.getOption('include')
- self.notitle = self.getOption('notitle')
def __iter__(self) -> Generator[Tuple[str, str], None, None]:
"""Read file and yield a tuple of page title and
content."""
@@ -254,26 +248,26 @@
def findpage(self, text) -> Tuple[int, str, str]:
"""Find page to work on."""
- if self.getOption('textonly'):
+ if self.opt.textonly:
pattern = '^(.*)$'
else:
- pattern = (re.escape(self.pageStartMarker) + '(.*?)'
- + re.escape(self.pageEndMarker))
+ pattern = (re.escape(self.opt.begin) + '(.*?)'
+ + re.escape(self.opt.end))
page_regex = re.compile(pattern, re.DOTALL)
title_regex = re.compile(
- re.escape(self.titleStartMarker) + '(.*?)'
- + re.escape(self.titleEndMarker))
+ re.escape(self.opt.titlestart) + '(.*?)'
+ + re.escape(self.opt.titleend))
location = page_regex.search(text)
- if self.include:
+ if self.opt.include:
contents = location.group()
else:
contents = location.group(1)
- title = self.getOption('title')
+ title = self.opt.title
if not title:
try:
title = title_regex.search(contents).group(1)
- if self.notitle:
+ if self.opt.notitle:
# Remove title (to allow creation of redirects)
contents = title_regex.sub('', contents, count=1)
except AttributeError:
diff --git a/scripts/patrol.py b/scripts/patrol.py
index 361b005..8104539 100755
--- a/scripts/patrol.py
+++ b/scripts/patrol.py
@@ -89,7 +89,7 @@
@kwarg autopatroluserns: Takes user consent to automatically patrol
@kwarg versionchecktime: Check versionchecktime lapse in sec
"""
- self.availableOptions.update({
+ self.available_options.update({
'ask': False,
'whitelist': None,
'versionchecktime': 300,
@@ -98,8 +98,8 @@
super().__init__(site, **kwargs)
self.recent_gen = True
self.user = None
- if self.getOption('whitelist'):
- self.whitelist_pagename = self.getOption('whitelist')
+ if self.opt.whitelist:
+ self.whitelist_pagename = self.opt.whitelist
else:
local_whitelist_subpage_name = pywikibot.translate(
self.site, self.whitelist_subpage_name, fallback=True)
@@ -130,7 +130,7 @@
raise mwparserfromhell
# Check for a more recent version after versionchecktime in sec.
if (self.whitelist_load_ts and (time.time() - self.whitelist_load_ts
- <
self.getOption('versionchecktime'))):
+ < self.opt.versionchecktime)):
verbose_output('Whitelist not stale yet')
return
@@ -308,11 +308,11 @@
self.load_whitelist()
self.repeat_start_ts = time.time()
- if pywikibot.config.verbose_output or self.getOption('ask'):
+ if pywikibot.config.verbose_output or self.opt.ask:
pywikibot.output('User {0} has created or modified page {1}'
.format(username, title))
- if (self.getOption('autopatroluserns')
+ if (self.opt.autopatroluserns
and page['ns'] in (2, 3)):
# simple rule to whitelist any user editing their own userspace
if
title.partition(':')[2].split('/')[0].startswith(username):
@@ -326,7 +326,7 @@
.format(username, title))
choice = True
- if self.getOption('ask'):
+ if self.opt.ask:
choice = pywikibot.input_yn(
'Do you want to mark page as patrolled?')
diff --git a/scripts/piper.py b/scripts/piper.py
index f89bc98..5e2fb34 100755
--- a/scripts/piper.py
+++ b/scripts/piper.py
@@ -65,7 +65,7 @@
to work on.
@type generator: generator
"""
- self.availableOptions.update({
+ self.available_options.update({
'filters': [],
})
super().__init__(generator=generator, **kwargs)
@@ -73,7 +73,7 @@
@property
def summary_parameters(self) -> dict:
"""Return the filter parameter."""
- return {'filters': ', '.join(self.getOption('filters'))}
+ return {'filters': ', '.join(self.opt.filters)}
def pipe(self, program: str, text: str) -> str:
"""Pipe a given text through a given program.
@@ -103,7 +103,7 @@
text = self.current_page.text
# Munge!
- for program in self.getOption('filters'):
+ for program in self.opt.filters:
text = self.pipe(program, text)
# only save if something was changed
--
To view, visit
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/637741
To unsubscribe, or for help writing mail filters, visit
https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I0023514519c375383a1a9c262cf804cb02574f05
Gerrit-Change-Number: 637741
Gerrit-PatchSet: 7
Gerrit-Owner: Udoka <UdokakuUgochukwu(a)gmail.com>
Gerrit-Reviewer: D3r1ck01 <xsavitar.wiki(a)aol.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged