Some more exceptions for mozilla drops.

This commit is contained in:
Tomeu Vizoso 2007-06-20 21:48:15 +02:00
parent d6bf24e456
commit de2c9c5322
3 changed files with 6 additions and 3 deletions

View File

@ -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]

View File

@ -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'

View File

@ -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' ])