[pitivi: 57/65] Fix discoverer.py so the application can open media files



commit a73102859360bc41dd3cef15ce1d94994e21d1e8
Author: Alex BÄluÈ <alexandru balut gmail com>
Date:   Sat Jun 25 20:04:32 2011 +0200

    Fix discoverer.py so the application can open media files

 pitivi/discoverer.py |    8 ++------
 1 files changed, 2 insertions(+), 6 deletions(-)
---
diff --git a/pitivi/discoverer.py b/pitivi/discoverer.py
index 8f37c14..8ebedff 100644
--- a/pitivi/discoverer.py
+++ b/pitivi/discoverer.py
@@ -26,7 +26,6 @@ Discover file multimedia information.
 
 from gettext import gettext as _
 import os
-from urlparse import urlparse
 import gobject
 gobject.threads_init()
 import gst
@@ -405,12 +404,9 @@ class Discoverer(Signallable, Loggable):
 
         # check if file exists and is readable
         if gst.uri_get_protocol(self.current_uri) == "file":
-            if not os.access(self.current_uri, os.F_OK):
-                self.error = _("File does not exist")
-            elif not os.access(self.current_uri, os.R_OK):
+            filename = gst.uri_get_location(self.current_uri)
+            if not os.access(filename, os.R_OK):
                 self.error = _("File not readable by current user")
-            
-            if self.error:
                 self.info("Error: %s", self.error)
                 self._finishAnalysis("File does not exist or is not readable by the current user")
                 return False



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]