[MediaWiki-commits] [Gerrit] labs...heritage[master]: Add default instructions to top of unused images reports

2017-09-26 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/380058 )

Change subject: Add default instructions to top of unused images reports
..


Add default instructions to top of unused images reports

Bug:T176200
Change-Id: I048bbb13761ea41996d252efff68b68036698dfd
---
M erfgoedbot/unused_monument_images.py
M tests/test_unused_monument_images.py
2 files changed, 16 insertions(+), 9 deletions(-)

Approvals:
  Lokal Profil: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/erfgoedbot/unused_monument_images.py 
b/erfgoedbot/unused_monument_images.py
index 78c7a79..78ab903 100644
--- a/erfgoedbot/unused_monument_images.py
+++ b/erfgoedbot/unused_monument_images.py
@@ -139,7 +139,12 @@
 order to ensure all candidates for a given monument id are presented.
 """
 # People can add a /header template for with more info
-text = u'{{#ifexist:{{FULLPAGENAME}}/header | {{/header}} }}\n'
+text = (
+u'{{#ifexist:{{FULLPAGENAME}}/header'
+u'|{{/header}}'
+u'|For information on how to use this report and how to localise '
+u'these instructions visit '
+u'[[:c:Commons:Monuments database/Unused images]]. }}\n')
 total_pages = 0
 total_ids = 0
 totalImages = 0
diff --git a/tests/test_unused_monument_images.py 
b/tests/test_unused_monument_images.py
index e1fe1aa..024d915 100644
--- a/tests/test_unused_monument_images.py
+++ b/tests/test_unused_monument_images.py
@@ -482,6 +482,12 @@
 self.mock_report_page = mock.create_autospec(
 unused_monument_images.pywikibot.Page,
 )
+self.prefix = (
+u'{{#ifexist:{{FULLPAGENAME}}/header'
+u'|{{/header}}'
+u'|For information on how to use this report and how to localise '
+u'these instructions visit '
+u'[[:c:Commons:Monuments database/Unused images]]. }}\n')
 
 self.unused_images = OrderedDict()
 self.unused_images['source_link_1'] = OrderedDict()
@@ -500,8 +506,7 @@
 
 def test_output_country_report_complete(self):
 expected_cmt = u'Images to be used in monument lists: 5'
-expected_output = (
-u'{{#ifexist:{{FULLPAGENAME}}/header | {{/header}} }}\n'
+expected_output = self.prefix + (
 u'=== source_link_1 ===\n'
 u'\n'
 u'File:filename1_11.jpg|id_11\n'
@@ -535,8 +540,7 @@
 expected_cmt = (
 u'Images to be used in monument lists: 2 (gallery maximum '
 u'reached), total of unused images: 5')
-expected_output = (
-u'{{#ifexist:{{FULLPAGENAME}}/header | {{/header}} }}\n'
+expected_output = self.prefix + (
 u'=== source_link_1 ===\n'
 u'\n'
 u'File:filename1_11.jpg|id_11\n'
@@ -566,8 +570,7 @@
 expected_cmt = (
 u'Images to be used in monument lists: 3 (gallery maximum '
 u'reached), total of unused images: 5')
-expected_output = (
-u'{{#ifexist:{{FULLPAGENAME}}/header | {{/header}} }}\n'
+expected_output = self.prefix + (
 u'=== source_link_1 ===\n'
 u'\n'
 u'File:filename1_11.jpg|id_11\n'
@@ -598,8 +601,7 @@
 self.unused_images = {}
 
 expected_cmt = u'Images to be used in monument lists: 0'
-expected_output = (
-u'{{#ifexist:{{FULLPAGENAME}}/header | {{/header}} }}\n'
+expected_output = self.prefix + (
 u'\nThere are no unused images left. Great work!\n')
 expected_totals = {
 'images': 0,

-- 
To view, visit https://gerrit.wikimedia.org/r/380058
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I048bbb13761ea41996d252efff68b68036698dfd
Gerrit-PatchSet: 4
Gerrit-Project: labs/tools/heritage
Gerrit-Branch: master
Gerrit-Owner: Lokal Profil 
Gerrit-Reviewer: Jean-Frédéric 
Gerrit-Reviewer: Lokal Profil 
Gerrit-Reviewer: Multichill 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] labs...heritage[master]: Add default instructions to top of unused images reports

2017-09-23 Thread Lokal Profil (Code Review)
Lokal Profil has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/380058 )

Change subject: Add default instructions to top of unused images reports
..

Add default instructions to top of unused images reports

Bug:T176200
Change-Id: I048bbb13761ea41996d252efff68b68036698dfd
---
M erfgoedbot/unused_monument_images.py
M tests/test_unused_monument_images.py
2 files changed, 15 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/labs/tools/heritage 
refs/changes/58/380058/1

diff --git a/erfgoedbot/unused_monument_images.py 
b/erfgoedbot/unused_monument_images.py
index f362583..3b2aa14 100644
--- a/erfgoedbot/unused_monument_images.py
+++ b/erfgoedbot/unused_monument_images.py
@@ -133,7 +133,12 @@
 order to ensure all candidates for a given monument id are presented.
 """
 # People can add a /header template for with more info
-text = u'{{#ifexist:{{FULLPAGENAME}}/header | {{/header}} }}\n'
+text = (
+u'{{#ifexist:{{FULLPAGENAME}}/header'
+u'|{{/header}}'
+u'|For information on how to use this report and how to localised '
+u'these instructions visit '
+u'[[:c:Commons:Monuments database/Unused images]]. }}\n')
 total_pages = 0
 total_ids = 0
 totalImages = 0
diff --git a/tests/test_unused_monument_images.py 
b/tests/test_unused_monument_images.py
index 6e47c7a..60218ed 100644
--- a/tests/test_unused_monument_images.py
+++ b/tests/test_unused_monument_images.py
@@ -479,6 +479,12 @@
 self.mock_report_page = mock.create_autospec(
 unused_monument_images.pywikibot.Page,
 )
+self.prefix = (
+u'{{#ifexist:{{FULLPAGENAME}}/header'
+u'|{{/header}}'
+u'|For information on how to use this report and how to localised '
+u'these instructions visit '
+u'[[:c:Commons:Monuments database/Unused images]]. }}\n')
 
 self.unused_images = OrderedDict()
 self.unused_images['source_link_1'] = OrderedDict()
@@ -497,8 +503,7 @@
 
 def test_output_country_report_complete(self):
 expected_cmt = u'Images to be used in monument lists: 5'
-expected_output = (
-u'{{#ifexist:{{FULLPAGENAME}}/header | {{/header}} }}\n'
+expected_output = self.prefix + (
 u'=== source_link_1 ===\n'
 u'\n'
 u'File:filename1_11.jpg|id_11\n'
@@ -532,8 +537,7 @@
 expected_cmt = (
 u'Images to be used in monument lists: 2 (gallery maximum '
 u'reached), total of unused images: 5')
-expected_output = (
-u'{{#ifexist:{{FULLPAGENAME}}/header | {{/header}} }}\n'
+expected_output = self.prefix + (
 u'=== source_link_1 ===\n'
 u'\n'
 u'File:filename1_11.jpg|id_11\n'
@@ -563,8 +567,7 @@
 expected_cmt = (
 u'Images to be used in monument lists: 3 (gallery maximum '
 u'reached), total of unused images: 5')
-expected_output = (
-u'{{#ifexist:{{FULLPAGENAME}}/header | {{/header}} }}\n'
+expected_output = self.prefix + (
 u'=== source_link_1 ===\n'
 u'\n'
 u'File:filename1_11.jpg|id_11\n'

-- 
To view, visit https://gerrit.wikimedia.org/r/380058
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I048bbb13761ea41996d252efff68b68036698dfd
Gerrit-PatchSet: 1
Gerrit-Project: labs/tools/heritage
Gerrit-Branch: master
Gerrit-Owner: Lokal Profil 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits