[pitivi] Add support for factories other than FileSourceFactory in ElementTreeFormatter.
- From: Edward Hervey <edwardrv src gnome org>
- To: svn-commits-list gnome org
- Subject: [pitivi] Add support for factories other than FileSourceFactory in ElementTreeFormatter.
- Date: Tue, 19 May 2009 12:07:14 -0400 (EDT)
commit 92e03b5a0851ee9453dedfe5416882de81d57799
Author: Alessandro Decina <alessandro d gmail com>
Date: Tue May 19 15:16:24 2009 +0200
Add support for factories other than FileSourceFactory in ElementTreeFormatter.
---
pitivi/formatters/etree.py | 20 ++++++++++----------
1 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/pitivi/formatters/etree.py b/pitivi/formatters/etree.py
index f37c26c..d4db807 100644
--- a/pitivi/formatters/etree.py
+++ b/pitivi/formatters/etree.py
@@ -166,17 +166,17 @@ class ElementTreeFormatter(Formatter):
# FIXME : we should check if the given ObjectFactory
# requires a filename !
filename = element.attrib.get("filename", None)
- if filename is None:
- return
- if isinstance(filename, unicode):
- filename = filename.encode("utf-8")
- filename = self.validateSourceURI(filename)
- if filename is None:
- return None
- if issubclass(klass, FileSourceFactory):
- factory = FileSourceFactory(filename)
- else:
+ if filename is not None:
+ if isinstance(filename, unicode):
+ filename = filename.encode("utf-8")
+ filename = self.validateSourceURI(filename)
+ if filename is None:
+ return None
+
+ if filename is not None:
factory = klass(filename)
+ else:
+ factory = klass()
factory.duration = long(element.attrib["duration"])
factory.default_duration = long(element.attrib["default_duration"])
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]