Skip to content

Commit

Permalink
better way to use favicon in provider_map
Browse files Browse the repository at this point in the history
  • Loading branch information
erinspace committed Jul 1, 2015
1 parent 4c1b9b3 commit 0524850
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,9 @@ def provider_map(delete=False):
es.indices.delete(index='share_providers', ignore=[404])

for harvester_name, harvester in registry.items():
favicon = urllib_parse.quote(base64.encodestring(open("img/favicons/{}_favicon.ico".format(harvester.short_name), "rb").read()))
with open("img/favicons/{}_favicon.ico".format(harvester.short_name), "rb") as f:
favicon = urllib_parse.quote(base64.encodestring(f.read()))

es.index(
'share_providers',
harvester.short_name,
Expand Down

0 comments on commit 0524850

Please sign in to comment.