From de2c9c53226006d2925e8428d8e50838d3d4c9d1 Mon Sep 17 00:00:00 2001 From: Tomeu Vizoso Date: Wed, 20 Jun 2007 21:48:15 +0200 Subject: [PATCH] Some more exceptions for mozilla drops. --- services/clipboard/clipboardobject.py | 6 +++++- services/clipboard/clipboardservice.py | 1 - services/clipboard/objecttypeservice.py | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/services/clipboard/clipboardobject.py b/services/clipboard/clipboardobject.py index b7f5805f..faca452e 100644 --- a/services/clipboard/clipboardobject.py +++ b/services/clipboard/clipboardobject.py @@ -105,11 +105,15 @@ class ClipboardObject: for mime_category in ['image/', 'text/', 'application/']: for mime_type in self._formats.keys(): - if mime_type.startswith(mime_category): + if mime_type.startswith(mime_category) and \ + not mime_type.split('/')[1].startswith('_'): mime_type = mime_type.split(';')[0] logging.debug('Choosed %r!' % mime_type) return mime_type + if 'STRING' in self._formats.keys(): + return 'text/plain' + logging.debug('Returning first: %r.' % self._formats.keys()[0]) return self._formats.keys()[0] diff --git a/services/clipboard/clipboardservice.py b/services/clipboard/clipboardservice.py index 3dbec16f..73552c4f 100644 --- a/services/clipboard/clipboardservice.py +++ b/services/clipboard/clipboardservice.py @@ -22,7 +22,6 @@ import dbus.service from sugar import env from sugar import util from clipboardobject import ClipboardObject, Format -import typeregistry NAME_KEY = 'NAME' PERCENT_KEY = 'PERCENT' diff --git a/services/clipboard/objecttypeservice.py b/services/clipboard/objecttypeservice.py index 70cf24f4..97f7d906 100644 --- a/services/clipboard/objecttypeservice.py +++ b/services/clipboard/objecttypeservice.py @@ -31,7 +31,7 @@ class ObjectTypeRegistry(dbus.service.Object): from gettext import gettext as _ self._add_primitive('Text', _('Text'), 'theme:object-text', [ 'text/plain', 'text/rtf', 'application/pdf', - 'application/x-pdf' ]) + 'application/x-pdf', 'text/html' ]) self._add_primitive('Image', _('Image'), 'theme:object-image', [ 'image/png', 'image/gif', 'image/jpeg' ])