From 1d2f84d0af4a88a0abb2a66dbabd56fe55e8f123 Mon Sep 17 00:00:00 2001 From: Tomeu Vizoso Date: Sat, 14 Jul 2007 11:53:49 +0000 Subject: #1888 Choose the correct mime type when adding text from Write to the clipboard. --- (limited to 'sugar/util.py') diff --git a/sugar/util.py b/sugar/util.py index 497eb53..814a728 100644 --- a/sugar/util.py +++ b/sugar/util.py @@ -128,25 +128,3 @@ def set_proc_title(title): except: return False -def choose_most_significant_mime_type(mime_types): - logging.debug('Choosing between %r.' % mime_types) - if not mime_types: - return '' - - if 'text/uri-list' in mime_types: - return 'text/uri-list' - - for mime_category in ['image/', 'text/', 'application/']: - for mime_type in mime_types: - 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 mime_types: - return 'text/plain' - - logging.debug('Returning first: %r.' % mime_types[0]) - return mime_types[0] - -- cgit v0.9.1