Xqt has uploaded a new change for review. https://gerrit.wikimedia.org/r/316312
Change subject: [IMPR] store fields to prevent code duplication in imagecopy_self.py ...................................................................... [IMPR] store fields to prevent code duplication in imagecopy_self.py Alsp keep lines beneath 80 chars Change-Id: I5bd048d31dc443ba0100f06f1006d6f5c2425e94 --- M scripts/imagecopy_self.py 1 file changed, 6 insertions(+), 6 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core refs/changes/12/316312/1 diff --git a/scripts/imagecopy_self.py b/scripts/imagecopy_self.py index 93599b9..e547846 100644 --- a/scripts/imagecopy_self.py +++ b/scripts/imagecopy_self.py @@ -85,10 +85,11 @@ nowCommonsTemplate = { 'de': u'{{NowCommons|%s}}', - 'en': u'{{NowCommons|1=File:%s|date=~~~~~|reviewer={{subst:REVISIONUSER}}}}', + 'en': '{{NowCommons|1=File:%s|date=~~~~~|reviewer={{subst:REVISIONUSER}}}}', 'lb': u'{{Elo op Commons|%s}}', 'nds-nl': u'{{NoenCommons|1=File:%s}}', - 'shared': u'{{NowCommons|1=File:%s|date=~~~~~|reviewer={{subst:REVISIONUSER}}}}', + 'shared': ('{{NowCommons|1=File:%s|date=~~~~~|' + 'reviewer={{subst:REVISIONUSER}}}}'), } moveToCommonsTemplate = { @@ -434,12 +435,11 @@ (field, sep, value) = param.partition(u'=') # To lowercase, remove underscores and strip of spaces field = field.lower().replace(u'_', u' ').strip() + fields = informationFields.get(imagepage.site.lang) # See if first part is in fields list - if field in informationFields.get( - imagepage.site.lang).keys(): + if field in fields.keys(): # Ok, field is good, store it. - contents[informationFields.get( - imagepage.site.lang).get(field)] = value.strip() + contents[fields.get(field)] = value.strip() # We now got the contents from the old information template. # Let's get the info for the new one -- To view, visit https://gerrit.wikimedia.org/r/316312 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5bd048d31dc443ba0100f06f1006d6f5c2425e94 Gerrit-PatchSet: 1 Gerrit-Project: pywikibot/core Gerrit-Branch: master Gerrit-Owner: Xqt <i...@gno.de> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits