jenkins-bot has submitted this change and it was merged.
Change subject: - remove undocumented and obsolete -dry option which is done by global
option -simulate - replace Page.site() with Page.site like in core - some pep8 changes
......................................................................
- remove undocumented and obsolete -dry option which is done by global option -simulate
- replace Page.site() with Page.site like in core
- some pep8 changes
Change-Id: I58deaf2d1cd86f77c01e63080ccdd9255b42fbea
---
M featured.py
1 file changed, 17 insertions(+), 18 deletions(-)
Approvals:
Legoktm: Looks good to me, approved
jenkins-bot: Verified
diff --git a/featured.py b/featured.py
index 277ad7b..eb7f37e 100644
--- a/featured.py
+++ b/featured.py
@@ -346,7 +346,7 @@
articles.append(p)
# Article talk (like in English)
elif p.namespace() == 1 and site.lang != 'el':
- articles.append(pywikibot.Page(p.site(),
+ articles.append(pywikibot.Page(p.site,
p.title(withNamespace=False)))
pywikibot.output(
'\03{lightred}** wikipedia:%s has %i %s articles\03{default}'
@@ -371,6 +371,7 @@
if p.site() == oursite:
ourpage = p
break
+
if not ourpage:
if not quiet:
pywikibot.output(u"%s -> no corresponding page in %s"
@@ -410,6 +411,7 @@
if p.site() == page.site():
backpage = p
break
+
if not backpage:
pywikibot.output(u"%s -> no back interwiki ref" % page.title())
return
@@ -448,8 +450,7 @@
return templates
-def featuredWithInterwiki(fromsite, tosite, template_on_top, pType, quiet,
- dry=False):
+def featuredWithInterwiki(fromsite, tosite, template_on_top, pType, quiet):
if not fromsite.lang in cache:
cache[fromsite.lang] = {}
if not tosite.lang in cache[fromsite.lang]:
@@ -474,7 +475,8 @@
continue
if a.title() in cc:
- pywikibot.output(u"(cached) %s -> %s" % (a.title(),
cc[a.title()]))
+ pywikibot.output(u"(cached) %s -> %s"
+ % (a.title(), cc[a.title()]))
continue
if a.isRedirectPage():
@@ -520,12 +522,11 @@
(u" {{%s|%s}}" % (templatelist[0],
fromsite.lang)) +
text[m.end():])
- if not dry:
- try:
- atrans.put(text, comment)
- except pywikibot.LockedPage:
- pywikibot.output(u'Page %s is locked!'
- % atrans.title())
+ try:
+ atrans.put(text, comment)
+ except pywikibot.LockedPage:
+ pywikibot.output(u'Page %s is locked!'
+ % atrans.title())
cc[a.title()] = atrans.title()
else:
if atrans:
@@ -542,12 +543,11 @@
i18n.twtranslate(site, 'featured-former',
{'page': unicode(a)}))
text = re.sub(re_Link_FA, '', text)
- if not dry:
- try:
- atrans.put(text, comment)
- except pywikibot.LockedPage:
- pywikibot.output(u'Page %s is locked!'
- % atrans.title())
+ try:
+ atrans.put(text, comment)
+ except pywikibot.LockedPage:
+ pywikibot.output(u'Page %s is locked!'
+ % atrans.title())
else:
pywikibot.output(u"(already done)")
cc[a.title()] = atrans.title()
@@ -665,8 +665,7 @@
break
elif fromsite != pywikibot.getSite():
featuredWithInterwiki(fromsite, pywikibot.getSite(),
- template_on_top, processType, quiet,
- pywikibot.simulate)
+ template_on_top, processType, quiet)
except KeyboardInterrupt:
pywikibot.output('\nQuitting program...')
finally:
--
To view, visit
https://gerrit.wikimedia.org/r/78817
To unsubscribe, visit
https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I58deaf2d1cd86f77c01e63080ccdd9255b42fbea
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: jenkins-bot