diff options
author | Gonzalo Odiard <godiard@gmail.com> | 2012-09-21 21:02:04 (GMT) |
---|---|---|
committer | Simon Schampijer <simon@laptop.org> | 2012-09-25 13:17:46 (GMT) |
commit | bcb2da9259164402bbf2bbdfbe4f0cf3ef2279d2 (patch) | |
tree | 3c7dc72b9544db70cbf59451dc5ef0ac6315eb2f | |
parent | 7359f2cba1dd78d1fb6ab9be269a7921473d6f79 (diff) |
Gio.content_type_guess now returns a dict instead of a str
This is a change in the api. The second element in the dict
is the certainty [1]. Errors connected with this change can
be seen when trying to access the Documents folder in the
Journal.
[1] http://developer.gnome.org/gio/stable/gio-GContentType.html#g-content-type-guess
Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
Acked-by: Simon Schampijer <simon@laptop.org>
-rw-r--r-- | src/jarabe/journal/model.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/jarabe/journal/model.py b/src/jarabe/journal/model.py index fb73db7..0a5b354 100644 --- a/src/jarabe/journal/model.py +++ b/src/jarabe/journal/model.py @@ -394,7 +394,8 @@ class InplaceResultSet(BaseResultSet): return if self._mime_types: - mime_type = Gio.content_type_guess(filename=full_path, data=None) + mime_type, uncertain_result_ = \ + Gio.content_type_guess(filename=full_path, data=None) if mime_type not in self._mime_types: return @@ -436,11 +437,13 @@ def _get_file_metadata(path, stat, fetch_preview=True): metadata['filesize'] = stat.st_size return metadata + mime_type, uncertain_result_ = Gio.content_type_guess(filename=path, + data=None) return {'uid': path, 'title': os.path.basename(path), 'timestamp': stat.st_mtime, 'filesize': stat.st_size, - 'mime_type': Gio.content_type_guess(filename=path, data=None), + 'mime_type': mime_type, 'activity': '', 'activity_id': '', 'icon-color': '#000000,#ffffff', |