[pitivi] Update factory.filename to point to the new filename when a file is moved.



commit 8c38e30c6d927f4436f9aab198d5bdd5d3bb8c0b
Author: Alessandro Decina <alessandro d gmail com>
Date:   Fri Aug 21 13:36:57 2009 +0200

    Update factory.filename to point to the new filename when a file is moved.

 pitivi/formatters/base.py  |    5 ++---
 pitivi/formatters/etree.py |    2 +-
 2 files changed, 3 insertions(+), 4 deletions(-)
---
diff --git a/pitivi/formatters/base.py b/pitivi/formatters/base.py
index 2f76b74..4681ba7 100644
--- a/pitivi/formatters/base.py
+++ b/pitivi/formatters/base.py
@@ -339,12 +339,11 @@ class Formatter(Signallable, Loggable):
         self.debug("uri:%s", uri)
         if not uri_is_valid(uri):
             self.warning("invalid URI")
-            raise FormatterError("invalid URI")
+            raise FormatterError("invalid URI", uri)
 
         # skip non local uri
         if not uri.split('://', 1)[0] in ["file"]:
-            self.warning("We can only handle file:// URI")
-            return uri
+            raise FormatterError("We can only handle file:// URI", uri)
 
         # first check the good old way
         if uri_is_valid(uri) and uri_is_reachable(uri):
diff --git a/pitivi/formatters/etree.py b/pitivi/formatters/etree.py
index 9d6a895..fc0431e 100644
--- a/pitivi/formatters/etree.py
+++ b/pitivi/formatters/etree.py
@@ -192,7 +192,7 @@ class ElementTreeFormatter(Formatter):
             filename1 = self.validateSourceURI(filename, factory)
             if filename != filename1:
                 # the file was moved
-                factory.uri = factory.filename = filename
+                factory.uri = factory.filename = filename1
 
         self._context.factories[element.attrib["id"]] = factory
         return factory



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