Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorTomeu Vizoso <tomeu@tomeuvizoso.net>2007-08-20 08:50:20 (GMT)
committer Tomeu Vizoso <tomeu@tomeuvizoso.net>2007-08-20 08:50:20 (GMT)
commitfff0daf8c4aef388f12f801162a050f13acd6cb8 (patch)
tree8ef155e280bf4a56f2b98b114a26144e5a539bb2 /services
parent7a641198433762c83a84e9464f103e33e38f8fa9 (diff)
Improvements in mime handling and added some tests.
Diffstat (limited to 'services')
-rw-r--r--services/shell/clipboardobject.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/services/shell/clipboardobject.py b/services/shell/clipboardobject.py
index 65f3bc5..c3cdab3 100644
--- a/services/shell/clipboardobject.py
+++ b/services/shell/clipboardobject.py
@@ -101,8 +101,11 @@ class ClipboardObject:
if len(uris) == 1 or not uris[1]:
uri = urlparse.urlparse(uris[0], 'file')
if uri.scheme == 'file':
- logging.debug('Choosed %r!' % mime.get_for_file(uri.path))
- format = mime.get_for_file(uri.path)
+ if os.path.exists(uri.path):
+ format = mime.get_for_file(uri.path)
+ else:
+ format = mime.get_from_file_name(uri.path)
+ logging.debug('Choosed %r!' % format)
return format