Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--services/clipboard/clipboardobject.py4
-rw-r--r--services/clipboard/typeregistry.py1
-rw-r--r--shell/view/frame/clipboardbox.py6
3 files changed, 6 insertions, 5 deletions
diff --git a/services/clipboard/clipboardobject.py b/services/clipboard/clipboardobject.py
index ab00b14..d712e09 100644
--- a/services/clipboard/clipboardobject.py
+++ b/services/clipboard/clipboardobject.py
@@ -1,5 +1,6 @@
import os
import logging
+import urlparse
import typeregistry
@@ -58,7 +59,8 @@ class Format:
def destroy(self):
if self._on_disk:
- os.remove(self._data.replace('file://', ''))
+ uri = urlparse.urlparse(self._data)
+ os.remove(uri.path)
def get_type(self):
return self._type
diff --git a/services/clipboard/typeregistry.py b/services/clipboard/typeregistry.py
index 93cc7e6..eaaf6cb 100644
--- a/services/clipboard/typeregistry.py
+++ b/services/clipboard/typeregistry.py
@@ -598,7 +598,6 @@ class UriListFileType(FileType):
if len(uris) == 1:
uri = urlparse.urlparse(uris[0])
ext = posixpath.splitext(uri[2])[1]
- logging.debug(ext)
# FIXME: Bad hack, the type registry should treat text/uri-list as a special case.
if ext in ['.jpg', '.jpeg', '.gif', '.png', '.svg']:
return True
diff --git a/shell/view/frame/clipboardbox.py b/shell/view/frame/clipboardbox.py
index fc81bce..8eab85f 100644
--- a/shell/view/frame/clipboardbox.py
+++ b/shell/view/frame/clipboardbox.py
@@ -87,15 +87,15 @@ class ClipboardBox(hippo.CanvasBox):
if len(uris) > 1:
raise NotImplementedError('Multiple uris in text/uri-list still not supported.')
uri = urlparse.urlparse(uris[0])
- path, file_name = os.path.split(uri[2])
+ path, file_name = os.path.split(uri.path)
# Copy the file, as it will be deleted when the dnd operation finishes.
new_file_path = os.path.join(path, 'cb' + file_name)
- shutil.copyfile(uri[2], new_file_path)
+ shutil.copyfile(uri.path, new_file_path)
cb_service.add_object_format(object_id,
selection.type,
- uri[0] + "://" + new_file_path,
+ "file://" + new_file_path,
on_disk=True)
else:
cb_service.add_object_format(object_id,