jenkins-bot has submitted this change and it was merged.
Change subject: [IMPROV] Shorten output text and add period at end
......................................................................
[IMPROV] Shorten output text and add period at end
Add a period after each “Skipping” output. Also change texts to remove need for
escaped quotes by not using contractions and bring line lengths of changed
lines below 80 chars.
Change-Id: I4fc39bba945bc8e9badf59b74f90cb7fb6c08a11
---
M scripts/harvest_template.py
1 file changed, 10 insertions(+), 6 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/scripts/harvest_template.py b/scripts/harvest_template.py
index c131a23..e4a82f3 100755
--- a/scripts/harvest_template.py
+++ b/scripts/harvest_template.py
@@ -83,7 +83,8 @@
linked_page = pywikibot.Page(link)
if not linked_page.exists():
- pywikibot.output(u'%s doesn\'t exist so it can\'t be linked.
Skipping' % (linked_page))
+ pywikibot.output('%s does not exist so it cannot be linked. '
+ 'Skipping.' % (linked_page))
return
if linked_page.isRedirectPage():
@@ -95,11 +96,12 @@
linked_item = None
if not linked_item or not linked_item.exists():
- pywikibot.output(u'%s doesn\'t have a wikidata item to link with.
Skipping' % (linked_page))
+ pywikibot.output('%s does not have a wikidata item to link with. '
+ 'Skipping.' % (linked_page))
return
if linked_item.title() == item.title():
- pywikibot.output(u'%s links to itself. Skipping' % (linked_page))
+ pywikibot.output('%s links to itself. Skipping.' % (linked_page))
return
return linked_item
@@ -109,7 +111,8 @@
self.current_page = page
item.get()
if set(self.fields.values()) <= set(item.claims.keys()):
- pywikibot.output(u'%s item %s has claims for all properties.
Skipping' % (page, item.title()))
+ pywikibot.output('%s item %s has claims for all properties. '
+ 'Skipping.' % (page, item.title()))
return
pagetext = page.get()
@@ -136,7 +139,7 @@
claim = pywikibot.Claim(self.repo, self.fields[field])
if claim.getID() in item.get().get('claims'):
pywikibot.output(
- u'A claim for %s already exists. Skipping'
+ 'A claim for %s already exists. Skipping.'
% claim.getID())
# TODO: Implement smarter approach to merging
# harvested values with existing claims esp.
@@ -147,7 +150,8 @@
match = re.search(pywikibot.link_regex, value)
if not match:
pywikibot.output(
- u'%s field %s value %s isnt a wikilink.
Skipping'
+ '%s field %s value %s is not a '
+ 'wikilink. Skipping.'
% (claim.getID(), field, value))
continue
--
To view, visit
https://gerrit.wikimedia.org/r/226054
To unsubscribe, visit
https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I4fc39bba945bc8e9badf59b74f90cb7fb6c08a11
Gerrit-PatchSet: 2
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: XZise <CommodoreFabianus(a)gmx.de>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: XZise <CommodoreFabianus(a)gmx.de>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot <>