Commit ff78af89 authored by Jim Tittsler's avatar Jim Tittsler

Upload new image versions.

* set ignorewarnings on upload to allow overwriting images
* remove leading/trailing whitespace on institution names
* link to script in Template:OERu Featured Partner
parent a595749a
......@@ -44,7 +44,7 @@ def get_partners(u):
for node in partner_nodes:
img = node.xpath('img')[0]
partners.append({
"name": img.xpath('string(@alt)'),
"name": img.xpath('string(@alt)').strip(),
"url": OERu + node.xpath('string(@href)'),
"img": OERu + img.xpath('string(@src)')
})
......@@ -73,6 +73,7 @@ def get_image_files(we, partners):
try:
we.upload(file=StringIO(img.content),
filename=filename,
ignore=True,
description='OERu partner %s logo' % (partner['name']))
except mwclient.errors.FileExists:
print "FILE %s EXISTS!" % (filename)
......@@ -150,7 +151,7 @@ def featured_partner(we, partners):
numparts = len(partners)
partners = sorted(partners, key=lambda k: k['name'])
body = []
body.append('<noinclude>This template is created by the oerupartners.py script, DO NOT HAND EDIT.')
body.append('<noinclude>This template is created by the [https://bitbucket.org/wikieducator/oerupartners/ oerupartners.py script], DO NOT HAND EDIT.')
body.append('')
body.append('</noinclude>{{Lozenge|style=background:#C3A8C9;|text=Featured OERu Partner}}')
body.append('')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment