Xqt has submitted this change and it was merged. (
https://gerrit.wikimedia.org/r/598180
)
Change subject: [cleanup] warnfile.py wasn't ported to core
......................................................................
[cleanup] warnfile.py wasn't ported to core
warnfile.py wasn't ported to core and the related Task T59097 was
declined. Remove the remaining codes from interwiki.py because it
is not functional.
Change-Id: I822fb44361d3691bc6326642ac5ca8dca3f979b5
---
M scripts/interwiki.py
1 file changed, 2 insertions(+), 32 deletions(-)
Approvals:
Huji: Looks good to me, approved
jenkins-bot: Verified
diff --git a/scripts/interwiki.py b/scripts/interwiki.py
index 9fd6a7d..f76aa75 100755
--- a/scripts/interwiki.py
+++ b/scripts/interwiki.py
@@ -51,14 +51,6 @@
pages, continue alphabetically starting at the last of the
dumped pages. The dump file will be subsequently removed.
- -warnfile: used as -warnfile:filename, reads all warnings from the
- given file that apply to the home wiki language,
- and read the rest of the warning as a hint. Then
- treats all the mentioned pages. A quicker way to
- implement warnfile suggestions without verifying them
- against the live wiki is using the warnfile.py
- script.
-
¶ms;
Additionally, these arguments can be used to restrict the bot to certain pages:
@@ -2243,23 +2235,6 @@
return True
-def readWarnfile(filename, bot):
- """Read old interlanguage conflicts."""
- import warnfile
- reader = warnfile.WarnfileReader(filename)
- # we won't use removeHints
- (hints, removeHints) = reader.getHints()
- for page, pagelist in hints.items():
- # The WarnfileReader gives us a list of pagelinks, but
- # titletranslate.py expects a list of strings, so we convert it back.
- # TODO: This is a quite ugly hack, in the future we should maybe make
- # titletranslate expect a list of pagelinks.
- hintStrings = ['{}:{}'.format(hintedPage.site.lang,
- hintedPage.title())
- for hintedPage in pagelist]
- bot.add(page, hints=hintStrings)
-
-
def page_empty_check(page):
"""
Return True if page should be skipped as it is almost empty.
@@ -2301,7 +2276,6 @@
namespaces = []
number = None
until = None
- warnfile = None
# a normal PageGenerator (which doesn't give hints, only Pages)
hintlessPageGen = None
optContinue = False
@@ -2319,9 +2293,8 @@
for arg in local_args:
if iwconf.readOptions(arg):
continue
- elif arg.startswith('-warnfile:'):
- warnfile = arg[10:]
- elif arg.startswith('-years'):
+
+ if arg.startswith('-years'):
# Look if user gave a specific year at which to start
# Must be a natural number or negative integer.
if len(arg) > 7 and (arg[7:].isdigit()
@@ -2436,9 +2409,6 @@
hintlessPageGen, namespaces, site)
# we'll use iter() to create make a next() function available.
bot.setPageGenerator(iter(hintlessPageGen), number=number, until=until)
- elif warnfile:
- # TODO: filter namespaces if -namespace parameter was used
- readWarnfile(warnfile, bot)
else:
if not singlePageTitle and not opthintsonly:
singlePageTitle = pywikibot.input('Which page to check:')
--
To view, visit
https://gerrit.wikimedia.org/r/598180
To unsubscribe, or for help writing mail filters, visit
https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I822fb44361d3691bc6326642ac5ca8dca3f979b5
Gerrit-Change-Number: 598180
Gerrit-PatchSet: 2
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: ChongDae <cdpark(a)gmail.com>
Gerrit-Reviewer: D3r1ck01 <xsavitar.wiki(a)aol.com>
Gerrit-Reviewer: Huji <huji.huji(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot (75)