Skip to content

Commit

Permalink
+ make plot helper robust against input missing MIME type listings by…
Browse files Browse the repository at this point in the history
… publishers
  • Loading branch information
erlehmann committed Feb 17, 2013
1 parent 9b4f50f commit 57724f9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion plot-helper
Expand Up @@ -157,7 +157,11 @@ with open(doi_pref_filename) as f:
doi_prefix_mapping[doi_prefix] = publisher

def plot_mimetypes_by_publisher(license_type, mime_type):
mimetypes = stats['mimetypes_prefix_publishers'][license_type][mime_type]
try:
mimetypes = stats['mimetypes_prefix_publishers'][license_type][mime_type]
except KeyError:
stderr.write('No MIME type listing by publishers found for %s materials.\n' % mime_type)
return
labels, values = zip(*sorted(mimetypes.iteritems(), key=lambda x: x[1]))

fig1 = figure(figsize=(8,8))
Expand Down

0 comments on commit 57724f9

Please sign in to comment.