From: András Veres-Szentkirályi Date: Thu, 21 Feb 2013 10:31:08 +0000 (+0100) Subject: use list expression instead of 3-deep for X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=6dc508d27f4a914e3d2ca66ac78fc2edabe669e8;p=mediagoblin.git use list expression instead of 3-deep for --- diff --git a/mediagoblin/tools/exif.py b/mediagoblin/tools/exif.py index ac111694..2c0a1143 100644 --- a/mediagoblin/tools/exif.py +++ b/mediagoblin/tools/exif.py @@ -114,13 +114,8 @@ def _ifd_tag_to_dict(tag): data['printable'] = tag.printable.decode('utf8', 'replace') if type(tag.values) == list: - data['values'] = [] - for val in tag.values: - if isinstance(val, Ratio): - data['values'].append( - _ratio_to_list(val)) - else: - data['values'].append(val) + data['values'] = [_ratio_to_list(val) if isinstance(val, Ratio) else val + for val in tag.values] else: if isinstance(tag.values, str): # Force UTF-8, so that it fits into the DB