jenkins-bot has submitted this change and it was merged.
Change subject: (bug 55584) only install pywikibot.*
......................................................................
(bug 55584) only install pywikibot.*
After hitting setuptools with a hammer in the right places, this
seems to be the best way of doing it. The alternative is listing
packages manually (['pywikibot', 'pywikibot.comms', ...]) or
having a huge exclude list (['tests', 'tests.*', ...]).
Change-Id: Ie1dd6b6e5558edd48b6a1a2fef96b665f7339b78
---
M setup.py
1 file changed, 3 insertions(+), 1 deletion(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/setup.py b/setup.py
index 855c91b..2c7c279 100644
--- a/setup.py
+++ b/setup.py
@@ -56,7 +56,9 @@
version='2.0b1',
description='Python Wikipedia Bot Framework',
license='MIT License',
- packages=find_packages(),
+ packages=[package
+ for package in find_packages()
+ if package.startswith('pywikibot.')],
install_requires=[
'httplib2>=0.6.0'
],
--
To view, visit https://gerrit.wikimedia.org/r/101661
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ie1dd6b6e5558edd48b6a1a2fef96b665f7339b78
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: Legoktm <legoktm.wikipedia(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot
jenkins-bot has submitted this change and it was merged.
Change subject: Fix bug 54684 by setting _isredir to false if it doesn't exist yet
......................................................................
Fix bug 54684 by setting _isredir to false if it doesn't exist yet
Bug: 54684
Change-Id: I7205548ddb776203d7f48f9ac746787dae33ce04
---
M pywikibot/site.py
1 file changed, 1 insertion(+), 0 deletions(-)
Approvals:
Merlijn van Deen: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/site.py b/pywikibot/site.py
index fe9fb16..27558be 100644
--- a/pywikibot/site.py
+++ b/pywikibot/site.py
@@ -1381,6 +1381,7 @@
def page_isredirect(self, page):
"""Return True if and only if page is a redirect."""
if not hasattr(page, "_isredir"):
+ page._isredir = False # bug 54684
self.loadpageinfo(page)
return page._isredir
--
To view, visit https://gerrit.wikimedia.org/r/101784
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I7205548ddb776203d7f48f9ac746787dae33ce04
Gerrit-PatchSet: 3
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Sn1per <geofbot(a)gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot
jenkins-bot has submitted this change and it was merged.
Change subject: Add ability to mark pages for deletion
......................................................................
Add ability to mark pages for deletion
When a non-admin tries Page.delete(), offer to
mark the page for deletion using {{delete}}.
If mark == True, the page will be marked for
deletion automatically.
Change-Id: I91a93a6dccab15315d44404347d34ef9f57963c0
---
M pywikibot/page.py
1 file changed, 37 insertions(+), 22 deletions(-)
Approvals:
Strainu: Looks good to me, but someone else must approve
Merlijn van Deen: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/page.py b/pywikibot/page.py
index a4a946c..f0150cd 100644
--- a/pywikibot/page.py
+++ b/pywikibot/page.py
@@ -1273,35 +1273,50 @@
def delete(self, reason=None, prompt=True, throttle=None, mark=False):
"""Deletes the page from the wiki. Requires administrator status.
- @param reason: The edit summary for the deletion. If None, ask for it.
+ @param reason: The edit summary for the deletion, or rationale
+ for deletion if requesting. If None, ask for it.
@param prompt: If true, prompt user for confirmation before deleting.
- @param mark: if true, and user does not have sysop rights, place a
- speedy-deletion request on the page instead.
+ @param mark: If true, and user does not have sysop rights, place a
+ speedy-deletion request on the page instead. If false, non-sysops
+ will be asked before marking pages for deletion.
"""
- # TODO: add support for mark
if reason is None:
pywikibot.output(u'Deleting %s.' % (self.title(asLink=True)))
reason = pywikibot.input(u'Please enter a reason for the deletion:')
- answer = u'y'
- if prompt and not hasattr(self.site, '_noDeletePrompt'):
- answer = pywikibot.inputChoice(
- u'Do you want to delete %s?' % self.title(asLink=True,
- forceInterwiki=True),
- ['Yes', 'No', 'All'],
- ['Y', 'N', 'A'],
- 'N')
- if answer in ['a', 'A']:
- answer = 'y'
- self.site._noDeletePrompt = True
- if answer in ['y', 'Y']:
- try:
+
+ if self.site.logged_in(sysop=True): # If user is a sysop, delete the page
+ answer = u'y'
+ if prompt and not hasattr(self.site, '_noDeletePrompt'):
+ answer = pywikibot.inputChoice(
+ u'Do you want to delete %s?' % self.title(asLink=True,
+ forceInterwiki=True),
+ ['Yes', 'No', 'All'],
+ ['Y', 'N', 'A'],
+ 'N')
+ if answer in ['a', 'A']:
+ answer = 'y'
+ self.site._noDeletePrompt = True
+ if answer in ['y', 'Y']:
return self.site.deletepage(self, reason)
- except pywikibot.NoUsername as e:
- if mark:
- raise NotImplementedError(
- "Marking pages for deletion is not yet available.")
- raise e
+ else: # Otherwise mark it for deletion
+ if mark or hasattr(self.site, '_noMarkDeletePrompt'):
+ answer = 'y'
+ else:
+ answer = pywikibot.inputChoice(
+ u"Can't delete %s; do you want to mark it "
+ "for deletion instead?" % self.title(asLink=True,
+ forceInterwiki=True),
+ ['Yes', 'No', 'All'],
+ ['Y', 'N', 'A'],
+ 'N')
+ if answer in ['a', 'A']:
+ answer = 'y'
+ self.site._noMarkDeletePrompt = True
+ if answer in ['y', 'Y']:
+ template = '{{delete|1=%s}}\n' % reason
+ self.text = template + self.text
+ return self.save(comment=reason)
# all these DeletedRevisions methods need to be reviewed and harmonized
# with the new framework; they do not appear functional
--
To view, visit https://gerrit.wikimedia.org/r/101613
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I91a93a6dccab15315d44404347d34ef9f57963c0
Gerrit-PatchSet: 3
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Theopolisme <theopolismewiki(a)gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: Strainu <wiki(a)strainu.ro>
Gerrit-Reviewer: Theopolisme <theopolismewiki(a)gmail.com>
Gerrit-Reviewer: jenkins-bot
jenkins-bot has submitted this change and it was merged.
Change subject: Port catall.py to core
......................................................................
Port catall.py to core
Change-Id: I92e6a4adf5276c55624fa14239c79ac4d5a282e8
---
A scripts/catall.py
1 file changed, 116 insertions(+), 0 deletions(-)
Approvals:
Merlijn van Deen: Looks good to me, approved
jenkins-bot: Verified
diff --git a/scripts/catall.py b/scripts/catall.py
new file mode 100755
index 0000000..c99ac4d
--- /dev/null
+++ b/scripts/catall.py
@@ -0,0 +1,116 @@
+# -*- coding: utf-8 -*-
+"""
+Add or change categories on a number of pages. Usage: catall.py name - goes
+through pages, starting at 'name'. Provides the categories on the page and asks
+whether to change them. If no starting name is provided, the bot starts at 'A'.
+
+Options:
+-onlynew : Only run on pages that do not yet have a category.
+"""
+#
+# (C) Rob W.W. Hooft, Andre Engels, 2004
+# (C) Pywikibot team, 2004-2013
+#
+# Distributed under the terms of the MIT license.
+#
+__version__ = '$Id$'
+#
+
+import sys
+import pywikibot
+from pywikibot import i18n
+
+
+def choosecats(pagetext):
+ chosen = []
+ done = False
+ length = 1000
+ print("""Give the new categories, one per line.
+Empty line: if the first, don't change. Otherwise: Ready.
+-: I made a mistake, let me start over.
+?: Give the text of the page with GUI.
+??: Give the text of the page in console.
+xx: if the first, remove all categories and add no new.
+q: quit.""")
+ while not done:
+ choice = pywikibot.input(u"?")
+ if choice == "":
+ done = True
+ elif choice == "-":
+ chosen = choosecats(pagetext)
+ done = True
+ elif choice == "?":
+ from pywikibot import editor as editarticle
+ editor = editarticle.TextEditor()
+ newtext = editor.edit(pagetext)
+ elif choice == "??":
+ pywikibot.output(pagetext[0:length])
+ length = length + 500
+ elif choice == "xx" and chosen == []:
+ chosen = None
+ done = True
+ elif choice == "q":
+ print "quit..."
+ sys.exit()
+ else:
+ chosen.append(choice)
+ return chosen
+
+
+def make_categories(page, list, site=None):
+ if site is None:
+ site = pywikibot.getSite()
+ pllist = []
+ for p in list:
+ cattitle = "%s:%s" % (site.category_namespace(), p)
+ pllist.append(pywikibot.Page(site, cattitle))
+ page.put_async(pywikibot.replaceCategoryLinks(page.get(), pllist),
+ comment=i18n.twtranslate(site.lang, 'catall-changing'))
+
+
+def main():
+ docorrections = True
+ start = []
+
+ for arg in pywikibot.handleArgs():
+ if arg == '-onlynew':
+ docorrections = False
+ else:
+ start.append(arg)
+
+ if not start:
+ start = 'A'
+ else:
+ start = ' '.join(start)
+
+ mysite = pywikibot.getSite()
+
+ for p in mysite.allpages(start=start):
+ try:
+ text = p.get()
+ cats = p.categories()
+ if not cats:
+ pywikibot.output(u"========== %s ==========" % p.title())
+ print "No categories"
+ print "-" * 40
+ newcats = choosecats(text)
+ if newcats != [] and newcats is not None:
+ make_categories(p, newcats, mysite)
+ elif docorrections:
+ pywikibot.output(u"========== %s ==========" % p.title())
+ for c in cats:
+ pywikibot.output(c.title())
+ print "-" * 40
+ newcats = choosecats(text)
+ if newcats is None:
+ make_categories(p, [], mysite)
+ elif newcats != []:
+ make_categories(p, newcats, mysite)
+ except pywikibot.IsRedirectPage:
+ pywikibot.output(u'%s is a redirect' % p.title())
+
+if __name__ == "__main__":
+ try:
+ main()
+ finally:
+ pywikibot.stopme()
--
To view, visit https://gerrit.wikimedia.org/r/101642
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I92e6a4adf5276c55624fa14239c79ac4d5a282e8
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: M4tx <m4tx(a)m4tx.pl>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: Strainu <wiki(a)strainu.ro>
Gerrit-Reviewer: jenkins-bot
jenkins-bot has submitted this change and it was merged.
Change subject: [SYNC] Synchronize with core. New meaning for -api option:
......................................................................
[SYNC] Synchronize with core. New meaning for -api option:
- Synchronize with core
- old -api option becomes -fullscan like in core
- there are three options now for retrieving redirect pages:
- xml from xml dump
- fullscan scans all pages (via api if available)
- moves scans all moved pages
if none of these options are given,
it retrieves redirects from special page
- mark -api option as deprecated
- remove old deprecated -number option and it's deprecated warning
(This warning has been implemented 18 months ago which should
be enough
- doc changed
Change-Id: I51de44d0f25bf5a1881613f5ba9badb7c4dbb9aa
---
M redirect.py
1 file changed, 68 insertions(+), 65 deletions(-)
Approvals:
Merlijn van Deen: Looks good to me, approved
jenkins-bot: Verified
diff --git a/redirect.py b/redirect.py
index 1f87d59..d2629d7 100644
--- a/redirect.py
+++ b/redirect.py
@@ -12,40 +12,39 @@
double Fix redirects which point to other redirects
broken Delete redirects where targets don\'t exist. Requires adminship.
-both Both of the above. Permitted only with -api. Implies -api.
+both Both of the above.
and arguments can be:
-xml Retrieve information from a local XML dump
(http://download.wikimedia.org). Argument can also be given as
- "-xml:filename.xml". Cannot be used with -api or -moves.
+ "-xml:filename.xml". Cannot be used with -fullscan or -moves.
--api Retrieve information from the wiki via MediaWikis application
- program interface (API). Cannot be used with -xml.
+-fullscan Retrieve redirect pages from live wiki, not from a special page
+ Cannot be used with -xml.
-moves Use the page move log to find double-redirect candidates. Only
- works with action "double", does not work with -xml. You may
- use -api option for retrieving pages via API
+ works with action "double", does not work with -xml.
- NOTE: If neither of -xml -api -moves is given, info will be
+ NOTE: You may use only one of these options above.
+ If neither of -xml -fullscan -moves is given, info will be
loaded from a special page of the live wiki.
-namespace:n Namespace to process. Can be given multiple times, for several
namespaces. If omitted, only the main (article) namespace is
- is treated with -api, with -xml all namespaces are treated,
- Works only with an XML dump, or the API interface.
+ treated.
-offset:n With -moves, the number of hours ago to start scanning moved
pages. With -xml, the number of the redirect to restart with
(see progress). Otherwise, ignored.
--start:title With -api, the starting page title in each namespace.
+-start:title With -fullscan, the starting page title in each namespace.
Otherwise ignored. Page needs not exist.
--until:title With -api, the possible last page title in each namespace.
+-until:title With -fullscan, the possible last page title in each namespace.
Otherwise ignored. Page needs not exist.
--total:n With -api, the maximum count of redirects to work upon.
+-total:n With -fullscan, the maximum count of redirects to work upon.
Otherwise ignored. Use 0 for unlimited
-always Don't prompt you for each replacement.
@@ -55,14 +54,16 @@
# (C) Daniel Herding, 2004.
# (C) Purodha Blissenbach, 2009.
# (C) xqt, 2009-2012
-# (C) Pywikipedia bot team, 2004-2013
+# (C) Pywikibot team, 2004-2013
#
# Distributed under the terms of the MIT license.
#
__version__ = '$Id$'
#
+
import re
import datetime
+import urllib
import wikipedia as pywikibot
from pywikibot import i18n
import config
@@ -128,7 +129,7 @@
or target.startswith(':%s:' % code):
if code == self.site.language():
# link to our wiki, but with the lang prefix
- target = target[(len(code)+1):]
+ target = target[(len(code) + 1):]
if target.startswith(':'):
target = target[1:]
else:
@@ -187,7 +188,8 @@
params['aplimit'] = int(data['limits']['allpages'])
for x in data['query']['allpages']:
done = self.api_until and x['title'] >= self.api_until
- if done: break
+ if done:
+ return
yield x['pageid']
if not done and 'query-continue' in data:
params.update(data['query-continue']['allpages'])
@@ -230,7 +232,6 @@
3 - target page of the redirect, or end of chain, or page title
where chain or loop detecton was halted, or None if unknown
"""
- import urllib
params = {
'action': 'query',
'redirects': 1,
@@ -312,7 +313,14 @@
yield key
def retrieve_double_redirects(self):
- if self.use_api and not self.use_move_log:
+ if self.use_move_log:
+ if self.site.has_api():
+ gen = self.get_moved_pages_redirects()
+ else:
+ gen = self.get_moved_pages_redirects_old()
+ for redir_page in gen:
+ yield redir_page.title()
+ elif self.use_api and self.site.has_api():
count = 0
for (pagetitle, type, target, final) \
in self.get_redirects_via_api(maxlen=2):
@@ -322,16 +330,18 @@
count += 1
if count >= self.api_number:
break
-
- elif not self.xmlFilename:
- if self.use_move_log:
- if self.use_api:
- gen = self.get_moved_pages_redirects()
- else:
- gen = self.get_moved_pages_redirects_old()
- for redir_page in gen:
- yield redir_page.title()
- return
+ elif self.xmlFilename:
+ redict = self.get_redirects_from_dump()
+ num = 0
+ for (key, value) in redict.iteritems():
+ num += 1
+ # check if the value - that is, the redirect target - is a
+ # redirect as well
+ if num > self.offset and value in redict:
+ yield key
+ pywikibot.output(u'\nChecking redirect %i of %i...'
+ % (num + 1, len(redict)))
+ else:
# retrieve information from the live wiki's maintenance page
# double redirect maintenance page's URL
# pywikibot.config.special_page_limit = 1000
@@ -347,17 +357,6 @@
% len(redir_names))
for redir_name in redir_names:
yield redir_name
- else:
- redict = self.get_redirects_from_dump()
- num = 0
- for (key, value) in redict.iteritems():
- num += 1
- # check if the value - that is, the redirect target - is a
- # redirect as well
- if num > self.offset and value in redict:
- yield key
- pywikibot.output(u'\nChecking redirect %i of %i...'
- % (num + 1, len(redict)))
def get_moved_pages_redirects(self):
'''generate redirects to recently-moved pages'''
@@ -365,8 +364,8 @@
if self.offset <= 0:
self.offset = 1
- start = datetime.datetime.utcnow() - \
- datetime.timedelta(0, self.offset * 3600)
+ start = (datetime.datetime.utcnow() -
+ datetime.timedelta(0, self.offset * 3600))
# self.offset hours ago
offset_time = start.strftime("%Y%m%d%H%M%S")
pywikibot.output(u'Retrieving %s moved pages via API...'
@@ -410,9 +409,9 @@
# self.offset hours ago
offset_time = start.strftime("%Y%m%d%H%M%S")
while True:
- move_url = \
-"%(path)s?title=Special:Log&limit=500&offset=%(offset)s&type=move&uselang=en" \
- % {'path': self.site.path(), 'offset': offset_time}
+ move_url = (
+ "%(path)s?title=Special:Log&limit=500&offset=%(offset)s&type=move&uselang=en" \
+ % {'path': self.site.path(), 'offset': offset_time})
try:
move_list = self.site.getUrl(move_url)
if pywikibot.verbose:
@@ -502,12 +501,12 @@
try:
redir_page.delete(reason, prompt=False)
except pywikibot.NoUsername:
- if (i18n.twhas_key(
- targetPage.site.lang,
- 'redirect-broken-redirect-template') and
- i18n.twhas_key(targetPage.site.lang,
- 'redirect-remove-broken')) or \
- targetPage.site.lang == '-':
+ if ((i18n.twhas_key(
+ targetPage.site.lang,
+ 'redirect-broken-redirect-template') and
+ i18n.twhas_key(targetPage.site.lang,
+ 'redirect-remove-broken')) or \
+ targetPage.site.lang == '-'):
pywikibot.output(u"No sysop in user-config.py, "
u"put page to speedy deletion.")
content = redir_page.get(get_redirect=True)
@@ -516,7 +515,7 @@
content = i18n.twtranslate(
targetPage.site.lang,
'redirect-broken-redirect-template'
- ) + "\n" + content
+ ) + "\n" + content
redir_page.put(content, reason)
except pywikibot.IsRedirectPage:
pywikibot.output(u"Redirect target %s is also a redirect! "
@@ -565,7 +564,7 @@
pywikibot.warning(
u"Redirect target section %s doesn't exist."
% newRedir.title(asLink=True))
- except pywikibot.BadTitle, e:
+ except pywikibot.BadTitle as e:
# str(e) is in the format 'BadTitle: [[Foo]]'
pywikibot.warning(
u'Redirect target %s is not a valid page title.'
@@ -618,7 +617,7 @@
pywikibot.warning(
u'Redirect target %s forms a redirect loop.'
% targetPage.title(asLink=True))
- break ### doesn't work. edits twice!
+ break # doesn't work. edits twice!
## try:
## content = targetPage.get(get_redirect=True)
## except pywikibot.SectionError:
@@ -673,18 +672,18 @@
redir.put(text, summary)
except pywikibot.LockedPage:
pywikibot.output(u'%s is locked.' % redir.title())
- except pywikibot.SpamfilterError, error:
+ except pywikibot.SpamfilterError as error:
pywikibot.output(
u"Saving page [[%s]] prevented by spam filter: %s"
% (redir.title(), error.url))
- except pywikibot.PageNotSaved, error:
+ except pywikibot.PageNotSaved as error:
pywikibot.output(u"Saving page [[%s]] failed: %s"
% (redir.title(), error))
except pywikibot.NoUsername:
pywikibot.output(
u"Page [[%s]] not saved; sysop privileges required."
% redir.title())
- except pywikibot.Error, error:
+ except pywikibot.Error as error:
pywikibot.output(
u"Unexpected error occurred trying to save [[%s]]: %s"
% (redir.title(), error))
@@ -736,7 +735,7 @@
# (only with dump); default to -1 which means all redirects are checked
offset = -1
moved_pages = False
- api = False
+ fullscan = False
start = ''
until = ''
number = None
@@ -748,8 +747,13 @@
action = 'broken'
elif arg == 'both':
action = 'both'
+ elif arg == '-fullscan':
+ fullscan = True
+ # old param, use -fullscan instead
elif arg == '-api':
- api = True
+ pywikibot.output(u'\nNOTE: -api option is deprecated.'
+ u' Use -fullscan instead')
+ fullscan = True
elif arg.startswith('-xml'):
if len(arg) == 4:
xmlFilename = i18n.input('pywikibot-enter-xml-filename')
@@ -780,21 +784,20 @@
until = arg[7:]
elif arg.startswith('-total:'):
number = int(arg[7:])
- # old param, use -total instead
- elif arg.startswith('-number:'):
- pywikibot.output(u'\nNOTE: -number option is deprecated.'
- u' Use -total instead')
- number = int(arg[8:])
elif arg == '-always':
always = True
else:
pywikibot.output(u'Unknown argument: %s' % arg)
- if not action or (xmlFilename and moved_pages) or (api and xmlFilename):
- pywikibot.showHelp('redirect')
+ if (
+ not action or
+ xmlFilename and moved_pages or
+ fullscan and xmlFilename
+ ):
+ pywikibot.showHelp()
else:
gen = RedirectGenerator(xmlFilename, namespaces, offset, moved_pages,
- api, start, until, number)
+ fullscan, start, until, number)
bot = RedirectRobot(action, gen, always, number)
bot.run()
--
To view, visit https://gerrit.wikimedia.org/r/101027
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I51de44d0f25bf5a1881613f5ba9badb7c4dbb9aa
Gerrit-PatchSet: 2
Gerrit-Project: pywikibot/compat
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: i18n: Allow empty translations
......................................................................
i18n: Allow empty translations
Check for 'trans is None' (= no translation found) instead of
for 'not trans' (= no translation found, or empty translation)
Can be relevant for empty configuration variables.
Change-Id: Icf8ca6a76d1fdcbe7be3a4ac276a5e9d0688108b
---
M pywikibot/i18n.py
1 file changed, 1 insertion(+), 1 deletion(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/i18n.py b/pywikibot/i18n.py
index 8e818eb..ac2c0f6 100644
--- a/pywikibot/i18n.py
+++ b/pywikibot/i18n.py
@@ -362,7 +362,7 @@
break
except KeyError:
continue
- if not trans:
+ if trans is None:
raise TranslationError("No English translation has been defined "
"for TranslateWiki key %r" % twtitle)
# send the language code back via the given list
--
To view, visit https://gerrit.wikimedia.org/r/101783
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Icf8ca6a76d1fdcbe7be3a4ac276a5e9d0688108b
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot