diff options
-rw-r--r-- | data/mime.types | 1 | ||||
-rw-r--r-- | services/clipboard/typeregistry.py | 22 |
2 files changed, 23 insertions, 0 deletions
diff --git a/data/mime.types b/data/mime.types index 0f76f39..a6ffcb2 100644 --- a/data/mime.types +++ b/data/mime.types @@ -1,2 +1,3 @@ application/x-squeak-project pr application/x-abiword abw +application/vnd.olpc-x-sugar xo diff --git a/services/clipboard/typeregistry.py b/services/clipboard/typeregistry.py index 88bdf60..8efcd61 100644 --- a/services/clipboard/typeregistry.py +++ b/services/clipboard/typeregistry.py @@ -237,6 +237,26 @@ class UriListFileType(FileType): return mime_type in cls._types matches_mime_type = classmethod(matches_mime_type) +class XoFileType(FileType): + + _types = set(['application/vnd.olpc-x-sugar']) + + def get_name(self): + return _('Activity package') + + def get_icon(self): + return 'theme:stock-missing' + + def get_preview(self): + return '' + + def get_activity(self): + return '' + + def matches_mime_type(cls, mime_type): + return mime_type in cls._types + matches_mime_type = classmethod(matches_mime_type) + class UnknownFileType(FileType): def get_name(self): return _('Object') @@ -267,10 +287,12 @@ class TypeRegistry: self._types.append(AbiwordFileType) self._types.append(TextFileType) self._types.append(SqueakProjectFileType) + self._types.append(XoFileType) def get_type(self, formats): for file_type in self._types: for format, data in formats.iteritems(): + logging.debug(format) if file_type.matches_mime_type(format): return file_type(formats) |