[Pkg-sugar-commit] [sugar-base] 04/13: Fix cannot open pdf on usb key (bslo #2008)

Jonas Smedegaard dr at jones.dk
Fri Apr 17 07:41:26 UTC 2015


This is an automated email from the git hooks/post-receive script.

js pushed a commit to annotated tag debian/0.84.2-1
in repository sugar-base.

commit 1cef182883fe359421d1ebfb5972f9056784badf
Author: Simon Schampijer <simon at schampijer.de>
Date:   Wed May 19 22:46:28 2010 +0530

    Fix cannot open pdf on usb key (bslo #2008)
---
 src/sugar/mime.py | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/sugar/mime.py b/src/sugar/mime.py
index 50e9a5e..dae3432 100644
--- a/src/sugar/mime.py
+++ b/src/sugar/mime.py
@@ -90,6 +90,11 @@ def get_all_generic_types():
     return types
 
 def get_for_file(file_name):
+    if file_name.startswith('file://'):
+        file_name = file_name[7:]
+
+    file_name = os.path.realpath(file_name)
+
     mime_type = _sugarbaseext.get_mime_type_for_file(file_name)
     if mime_type == 'application/octet-stream':
         if _file_looks_like_text(file_name):

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-sugar/sugar-base.git



More information about the pkg-sugar-commit mailing list