[pitivi] SourceList: Allow only giving the factory to addFactory.
- From: Edward Hervey <edwardrv src gnome org>
- To: svn-commits-list gnome org
- Subject: [pitivi] SourceList: Allow only giving the factory to addFactory.
- Date: Fri, 17 Apr 2009 09:37:00 -0400 (EDT)
commit 3bfd9a6e41d019f835e3785257d0ddb73ea8e11d
Author: Edward Hervey <bilboed bilboed com>
Date: Fri Apr 17 15:36:09 2009 +0200
SourceList: Allow only giving the factory to addFactory.
When providing a URISourceFactoryMixin factory we don't need to specify
the URI (it's contained in the factory).
---
pitivi/sourcelist.py | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/pitivi/sourcelist.py b/pitivi/sourcelist.py
index f7cac59..4b5eed0 100644
--- a/pitivi/sourcelist.py
+++ b/pitivi/sourcelist.py
@@ -26,6 +26,7 @@ import urllib
from pitivi.discoverer import Discoverer
from pitivi.signalinterface import Signallable
from pitivi.log.loggable import Loggable
+from pitivi.factories.base import URISourceFactoryMixin
class SourceList(object, Signallable, Loggable):
"""
@@ -137,10 +138,14 @@ class SourceList(object, Signallable, Loggable):
for uri in rmuri:
del self[uri]
- def addFactory(self, uri, factory):
+ # FIXME : Invert the order of the arguments so we can just have:
+ # addFactory(self, factory, uri=None)
+ def addFactory(self, uri=None, factory=None):
"""
Add an objectfactory for the given uri.
"""
+ if uri==None and isinstance(factory, URISourceFactoryMixin):
+ uri = factory.uri
if uri in self and self[uri]:
raise Exception("We already have an objectfactory for uri %s", uri)
self.sources[uri] = factory
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]