diff options
author | Simon Schampijer <simon@schampijer.de> | 2011-12-08 18:30:16 (GMT) |
---|---|---|
committer | Simon Schampijer <simon@schampijer.de> | 2011-12-08 18:30:16 (GMT) |
commit | 59aa01263c49e99edbcacf44a7494e5a021d2c62 (patch) | |
tree | f85672fd1db1a3c0eeb83fd5d61dff5ad58177d8 | |
parent | a9f65da08c84ae99f25919c7ae43d02af71d64b5 (diff) |
datastore: fix call to Gio.content_type_guess
The Gio.content_type_guess call has not been translated correctly by
the pygi-convert.sh script. In the static bindings it was only needed
to pass either the filename or the data argument. In the dynamic
bindings (see Gio-2.0.gir) we need to specify both.
from the static bindings:
content_type_guess(...)
content_type_guess([filename, data, want_uncertain]) -> mime type
Guesses the content type based on the parameters passed.
Either filename or data must be specified
Returns a string containing the mime type.
If want_uncertain is set to True, return a tuple with the mime type and
True/False if the type guess was uncertain or not.
-rw-r--r-- | src/sugar3/datastore/datastore.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/sugar3/datastore/datastore.py b/src/sugar3/datastore/datastore.py index 2ada474..e5057d6 100644 --- a/src/sugar3/datastore/datastore.py +++ b/src/sugar3/datastore/datastore.py @@ -231,7 +231,7 @@ class RawObject(object): 'uid': file_path, 'title': os.path.basename(file_path), 'timestamp': stat.st_mtime, - 'mime_type': Gio.content_type_guess(filename=file_path), + 'mime_type': Gio.content_type_guess(file_path, None), 'activity': '', 'activity_id': '', 'icon-color': client.get_string('/desktop/sugar/user/color'), |