Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorManuel QuiƱones <manuq@laptop.org>2012-08-30 02:42:01 (GMT)
committer Manuel QuiƱones <manuq@laptop.org>2012-08-30 02:42:01 (GMT)
commitad486d6df147874d6ba204cea0bd82671d5df3a8 (patch)
treebeb68ad929a4727271b37e15e2a537941d7b970f
parent123d856948e40f635839a411da044798fcee3060 (diff)
Fix API of Gio.content_type_guess
- now returns a tuple (mime_type, uncertain) the first is the original output, the second is a boolean. - now needs two non-keyword parameters
-rw-r--r--src/jarabe/journal/model.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/jarabe/journal/model.py b/src/jarabe/journal/model.py
index 88c2b09..fc8c41d 100644
--- a/src/jarabe/journal/model.py
+++ b/src/jarabe/journal/model.py
@@ -394,7 +394,7 @@ class InplaceResultSet(BaseResultSet):
return
if self._mime_types:
- mime_type = Gio.content_type_guess(filename=full_path)
+ mime_type, uncertain = Gio.content_type_guess(full_path, None)
if mime_type not in self._mime_types:
return
@@ -436,11 +436,12 @@ def _get_file_metadata(path, stat, fetch_preview=True):
metadata['filesize'] = stat.st_size
return metadata
+ mime_type, uncertain = Gio.content_type_guess(path, None)
return {'uid': path,
'title': os.path.basename(path),
'timestamp': stat.st_mtime,
'filesize': stat.st_size,
- 'mime_type': Gio.content_type_guess(path, None),
+ 'mime_type': mime_type,
'activity': '',
'activity_id': '',
'icon-color': '#000000,#ffffff',