From 5104e24ffa76768707551f4cf2c2e0528bdee408 Mon Sep 17 00:00:00 2001 From: Tomeu Vizoso Date: Sun, 18 Mar 2007 13:16:09 +0100 Subject: [PATCH] Hack for detecting an onDisk format. Need to improve the clipboard API for the right fix. --- shell/view/clipboardicon.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/shell/view/clipboardicon.py b/shell/view/clipboardicon.py index 5e941f67..0844dd21 100644 --- a/shell/view/clipboardicon.py +++ b/shell/view/clipboardicon.py @@ -114,7 +114,14 @@ class ClipboardIcon(CanvasIcon): formats = obj['FORMATS'] if len(formats) > 0: path = cb_service.get_object_data(self._object_id, formats[0]) - if os.path.exists(path): + + # FIXME: would be better to check for format.onDisk + try: + path_exists = os.path.exists(path) + except TypeError: + path_exists = False + + if path_exists: activityfactory.create_with_uri(self._activity, path) else: logging.debug("Clipboard item file path %s didn't exist" % path)