Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTomeu Vizoso <tomeu@tomeuvizoso.net>2008-01-09 15:15:23 (GMT)
committer Tomeu Vizoso <tomeu@tomeuvizoso.net>2008-01-09 15:15:23 (GMT)
commit86e83199b5501cdfb5a7ec496ee0aa32b0af4581 (patch)
treee8ed10d4e8d4e7d15072de03d4c00e004ab36b1d /src
parentcc7bbec111d691c198ef6c9ca761c8f576882d0a (diff)
#5389: Correctly handle pastes from gtk text entries.
Diffstat (limited to 'src')
-rw-r--r--src/sugar/mime.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/sugar/mime.py b/src/sugar/mime.py
index e54e063..fd79ad8 100644
--- a/src/sugar/mime.py
+++ b/src/sugar/mime.py
@@ -154,6 +154,11 @@ def get_primary_extension(mime_type):
else:
return None
+_black_list = [
+ # Target used only between gtk.TextBuffer instances
+ 'application/x-gtk-text-buffer-rich-text',
+ ]
+
def choose_most_significant(mime_types):
logging.debug('Choosing between %r.' % mime_types)
if not mime_types:
@@ -165,7 +170,7 @@ def choose_most_significant(mime_types):
for mime_category in ['image/', 'application/']:
for mime_type in mime_types:
- if mime_type.startswith(mime_category):
+ if mime_type.startswith(mime_category) and mime_type not in _black_list:
# skip mozilla private types (second component starts with '_'
# or ends with '-priv')
if mime_type.split('/')[1].startswith('_') or \