jenkins-bot has submitted this change and it was merged. (
https://gerrit.wikimedia.org/r/577177 )
Change subject: [IMPR] use original tag name
......................................................................
[IMPR] use original tag name
see
https://www.flickr.com/services/api/misc.tags.html
Change-Id: I30e563f94da9fc6d17cd79c154aecf90fd497c96
---
M scripts/flickrripper.py
1 file changed, 7 insertions(+), 3 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/scripts/flickrripper.py b/scripts/flickrripper.py
index 18fd6cc..f4c9631 100755
--- a/scripts/flickrripper.py
+++ b/scripts/flickrripper.py
@@ -141,12 +141,16 @@
return site.getFilesFromAnHash(base64.b16encode(hashObject.digest()))
-def getTags(photoInfo):
+def getTags(photoInfo, raw=False):
"""Get all the tags on a photo."""
result = []
for tag in
photoInfo.find('photo').find('tags').findall('tag'):
- result.append(tag.text.lower())
-
+ if raw:
+ # use original tag name
+ # see
https://www.flickr.com/services/api/misc.tags.html
+ result.append(tag.attrib['raw'].lower())
+ else:
+ result.append(tag.text.lower())
return result
--
To view, visit
https://gerrit.wikimedia.org/r/577177
To unsubscribe, or for help writing mail filters, visit
https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I30e563f94da9fc6d17cd79c154aecf90fd497c96
Gerrit-Change-Number: 577177
Gerrit-PatchSet: 6
Gerrit-Owner: Shizhao <shizhao(a)gmail.com>
Gerrit-Reviewer: D3r1ck01 <xsavitar.wiki(a)aol.com>
Gerrit-Reviewer: Shizhao <shizhao(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot (75)