r6242 - in flumotion/trunk: . flumotion/common flumotion/component flumotion/component/muxers flumotion/manager flumotion/test flumotion/worker

flumotion-commit at lists.fluendo.com flumotion-commit at lists.fluendo.com
Fri Feb 15 19:38:56 CET 2008


Author: jdahlin
Date: Fri Feb 15 19:38:55 2008
New Revision: 6242

Log:
2008-02-15  Johan Dahlin  <jdahlin at gnome.org>

    reviewed by: Mike

    * flumotion/common/config.py:
    * flumotion/common/registry.py:
    * flumotion/component/component.py:
    * flumotion/component/muxers/muxers.xml:
    * flumotion/manager/admin.py:
    * flumotion/test/test_component_bouncers_component.py:
    * flumotion/test/test_component_httpserver.py:
    * flumotion/test/test_config.py:
    * flumotion/test/test_registry.py:
    * flumotion/worker/worker.py:

    In preparation for bug 823.
    Registry changes:
    * Allow multiple <entry>'s for a <plug>.
    * Allow <wizard> to be placed in <plugs> in the registry
    * Improve validation of format media types.
    Admin PB API:
    * Add getPlugEntry, which can be used to fetch an entry point in a plug
    * Update getWizardEntries to also return entries for plugs, not just
      components
    Update worker, config, component modules, muxer xml and tests to take
    into account these changes.



Modified:
   flumotion/trunk/ChangeLog
   flumotion/trunk/flumotion/common/config.py
   flumotion/trunk/flumotion/common/registry.py
   flumotion/trunk/flumotion/component/component.py
   flumotion/trunk/flumotion/component/muxers/muxers.xml
   flumotion/trunk/flumotion/manager/admin.py
   flumotion/trunk/flumotion/test/test_component_bouncers_component.py
   flumotion/trunk/flumotion/test/test_component_httpserver.py
   flumotion/trunk/flumotion/test/test_config.py
   flumotion/trunk/flumotion/test/test_registry.py
   flumotion/trunk/flumotion/worker/worker.py

Modified: flumotion/trunk/ChangeLog
==============================================================================
--- flumotion/trunk/ChangeLog	(original)
+++ flumotion/trunk/ChangeLog	Fri Feb 15 19:38:55 2008
@@ -1,3 +1,30 @@
+2008-02-15  Johan Dahlin  <jdahlin at gnome.org>
+
+	reviewed by: Mike
+
+	* flumotion/common/config.py:
+	* flumotion/common/registry.py:
+	* flumotion/component/component.py:
+	* flumotion/component/muxers/muxers.xml:
+	* flumotion/manager/admin.py:
+	* flumotion/test/test_component_bouncers_component.py:
+	* flumotion/test/test_component_httpserver.py:
+	* flumotion/test/test_config.py:
+	* flumotion/test/test_registry.py:
+	* flumotion/worker/worker.py:
+
+	In preparation for bug 823.
+	Registry changes:
+	* Allow multiple <entry>'s for a <plug>.
+	* Allow <wizard> to be placed in <plugs> in the registry
+	* Improve validation of format media types.
+	Admin PB API:
+	* Add getPlugEntry, which can be used to fetch an entry point in a plug
+	* Update getWizardEntries to also return entries for plugs, not just
+	  components
+	Update worker, config, component modules, muxer xml and tests to take
+	into account these changes.
+
 2008-02-15  Johan Dahlin  <johan at gnome.org>
 
 	* flumotion/test/test_component_base_scheduler.py (EventTest.testRecurringOnce): Check

Modified: flumotion/trunk/flumotion/common/config.py
==============================================================================
--- flumotion/trunk/flumotion/common/config.py	(original)
+++ flumotion/trunk/flumotion/common/config.py	Fri Feb 15 19:38:55 2008
@@ -26,13 +26,8 @@
 import os
 import locale
 import sys
-from xml.dom import minidom, Node
-from xml.parsers import expat
 
-from twisted.python import reflect
-
-from flumotion.common import log, errors, common, registry, fxml
-from flumotion.configure import configure
+from flumotion.common import log, common, registry, fxml
 
 from errors import ConfigError
 
@@ -181,10 +176,19 @@
                                             defs.getProperties())
         self.config = {'type': self.type,
                        'socket': self.socket,
-                       'module-name': defs.entry.getModuleName(),
-                       'function-name': defs.entry.getFunction(),
+                       'entries' : self._parseEntries(defs),
                        'properties': self.properties}
 
+    def _parseEntries(self, entries):
+        d = {}
+        for entry in entries.getEntries():
+            d[entry.getType()] = {
+                'module-name': entry.getModuleName(),
+                'function-name': entry.getFunction(),
+                }
+        return d
+
+
 class BaseConfigParser(fxml.Parser):
     parserError = ConfigError
 

Modified: flumotion/trunk/flumotion/common/registry.py
==============================================================================
--- flumotion/trunk/flumotion/common/registry.py	(original)
+++ flumotion/trunk/flumotion/common/registry.py	Fri Feb 15 19:38:55 2008
@@ -43,7 +43,7 @@
 # decide that it's a good idea, or something. See #799.
 READ_CACHE = False
 
-_VALID_WIZARD_ENTRY_TYPES = [
+_VALID_WIZARD_COMPONENT_TYPES = [
     'audio-producer',
     'video-producer',
     'muxer',
@@ -51,6 +51,10 @@
     'video-encoder',
     ]
 
+_VALID_WIZARD_PLUG_TYPES = [
+    'http-consumer',
+    ]
+
 def _getMTime(file):
     return os.stat(file)[stat.ST_MTIME]
 
@@ -166,7 +170,7 @@
     I represent a <plug> entry in the registry
     """
 
-    def __init__(self, filename, type, socket, entry, properties):
+    def __init__(self, filename, type, socket, entries, properties, wizards):
         """
         @param filename:   name of the XML file this plug is parsed from
         @type  filename:   str
@@ -175,16 +179,19 @@
         @param socket:     the fully qualified class name of the socket this
                            plug can be plugged in to
         @type  socket:     str
-        @param entry:      entry point for instantiating the plug
-        @type  entry:      L{RegistryEntryEntry}
+        @param entries:    entry pointes for instantiating the plug
+        @type  entries:    list of L{RegistryEntryEntry}
         @param properties: properties of the plug
         @type  properties: dict of str -> L{RegistryEntryProperty}
+        @param wizards:    list of wizard entries
+        @type  wizards:    list of L{RegistryEntryWizard}
         """
         self.filename = filename
         self.type = type
         self.socket = socket
-        self.entry = entry
+        self.entries = entries
         self.properties = properties
+        self.wizards = wizards
 
     def getProperties(self):
         """
@@ -200,8 +207,19 @@
         """
         return name in self.properties.keys()
 
+    def getEntryByType(self, type):
+        """
+        Get the entry point for the given type of entry.
+
+        @type type: string
+        """
+        return self.entries[type]
+
     def getEntry(self):
-        return self.entry
+        return self.entries['default']
+
+    def getEntries(self):
+        return self.entries.values()
 
     def getType(self):
         return self.type
@@ -504,7 +522,7 @@
             'synchronization': (self._parseSynchronization,
                                 synchronization.set),
             'sockets':         (self._parseSockets, sockets.extend),
-            'wizard':          (self._parseWizard, wizards.append),
+            'wizard':          (self._parseComponentWizard, wizards.append),
         }
         self.parseFromTable(node, parsers)
 
@@ -666,34 +684,64 @@
         return required, clock_priority
 
     def _parsePlugEntry(self, node):
-        # <entry location="" function=""/>
-        # returns: RegistryEntryEntry
+        attrs = self.parseAttributes(node, ('location', 'function'), ('type',))
+        location, function, type = attrs
+        if not type:
+            type = 'default'
+        return RegistryEntryEntry(type, location, function)
 
-        attrs = self.parseAttributes(node, ('location', 'function'))
-        location, function = attrs
-        return RegistryEntryEntry('plug', location, function)
+    def _parseDefaultPlugEntry(self, node):
+        return {'default': self._parsePlugEntry(node)}
+
+    def _parsePlugEntries(self, node):
+        # <entries>
+        #   <entry>
+        # </entries>
+        # returns: dict of type -> entry
+
+        entries = {}
+        def addEntry(entry):
+            if entry.getType() in entries:
+                raise fxml.ParserError("entry %s already specified"
+                                       % entry.getType())
+            entries[entry.getType()] = entry
+
+        parsers = {'entry': (self._parsePlugEntry, addEntry)}
+
+        self.parseFromTable(node, parsers)
+
+        return entries
 
     def _parsePlug(self, node):
         # <plug socket="..." type="...">
+        #   <entries>
         #   <entry>
         #   <properties>
+        #   <wizard>
         # </plug>
 
         type, socket = self.parseAttributes(node, ('type', 'socket'))
 
-        entry = fxml.Box(None)
+        entries = {}
         properties = {}
+        wizards = []
 
-        parsers = {'entry': (self._parsePlugEntry, entry.set),
-                   'properties': (self._parseProperties, properties.update)}
+        parsers = {
+            'entries':    (self._parsePlugEntries, entries.update),
+            # backwards compatibility
+            'entry':      (self._parseDefaultPlugEntry, entries.update),
+            'properties': (self._parseProperties, properties.update),
+            'wizard':     (self._parsePlugWizard, wizards.append),
+            }
 
         self.parseFromTable(node, parsers)
 
-        if not entry.unbox():
-            raise fxml.ParserError("<plug> %s needs an <entry>" % type)
+        if not 'default' in entries:
+            raise fxml.ParserError("<plug> %s needs a default <entry>" % type)
 
         return RegistryEntryPlug(self.filename, type,
-                                 socket, entry.unbox(), properties)
+                                 socket, entries, properties,
+                                 wizards)
 
     def _parsePlugs(self, node):
         # <plugs>
@@ -798,7 +846,7 @@
         self.parseFromTable(node, parsers)
 
         return directories
-    
+
     def _parseBundleDirectoryFilename(self, node, name):
         attrs = self.parseAttributes(node, ('location',), ('relative',))
         location, relative = attrs
@@ -897,7 +945,13 @@
         filename, = self.parseAttributes(node, ('filename',))
         return RegistryDirectory(filename)
 
-    def _parseWizard(self, node):
+    def _parseComponentWizard(self, node):
+        return self._parseWizard(node, _VALID_WIZARD_COMPONENT_TYPES)
+
+    def _parsePlugWizard(self, node):
+        return self._parseWizard(node, _VALID_WIZARD_PLUG_TYPES)
+
+    def _parseWizard(self, node, validTypes):
         # <wizard type="..." _description=" " feeder="..." eater="..."]/>
         #
         # NOTE: We are using _description with the leading underscore for
@@ -911,31 +965,49 @@
 
         accepts = []
         provides = []
-        self.parseFromTable(
-            node,
-            { 'accept-format': (self._parseAcceptFormat,
-                                lambda n: accepts.append(n)),
-              'provide-format': (self._parseProvideFormat,
-                                 lambda n: provides.append(n)),
-            })
+        parsers = {
+            'accept-format': (self._parseAcceptFormat,
+                              lambda n: accepts.append(n)),
+            'provide-format': (self._parseProvideFormat,
+                               lambda n: provides.append(n)),
+            }
+        self.parseFromTable(node, parsers)
 
-        component_type = node.parentNode.getAttribute('type')
+        parent_type = node.parentNode.getAttribute('type')
 
-        if not type in _VALID_WIZARD_ENTRY_TYPES:
+        if not type in validTypes:
             raise fxml.ParserError(
                 "<wizard>'s type attribute is %s must be one of %s" % (
-                component_type,
-                ', '.join(_VALID_WIZARD_ENTRY_TYPES)))
-        if type in ['muxer'] and not accepts:
-            raise fxml.ParserError(
-                ('<wizard type="%s"> requires at least one accepted '
-                 'media-type.') % (component_type,))
-        if type.endswith('-encoder') and not provides:
-            raise fxml.ParserError(
-                ('<wizard type="%s"> requires at least one provided '
-                 'media-type.') % (component_type,))
+                parent_type,
+                ', '.join(validTypes)))
+
+        isProducer = type.endswith('-producer')
+        isEncoder = type.endswith('-encoder')
+        isMuxer = (type == 'muxer')
+        isConsumer = type.endswith('-consumer')
+
+        err = None
+        # Producers and Encoders cannot have provided
+        if accepts and (isProducer or isEncoder):
+            err = ('<wizard type="%s"> does not allow an accepted '
+                   'media-type.') % (parent_type,)
+        # Encoders, Muxers and Consumers must have an accepted
+        elif not accepts and (isMuxer or isConsumer):
+            err = ('<wizard type="%s"> requires at least one accepted '
+                   'media-type.') % (parent_type,)
+        # Producers and Consumers cannot have provided
+        elif provides and (isProducer or isConsumer):
+            err = ('<wizard type="%s"> does not allow a provided '
+                   'media-type.') % (parent_type,)
+        # Producers, Encoders and Muxers must have exactly one provided
+        if len(provides) != 1 and (isEncoder or isMuxer):
+            err = ('<wizard type="%s"> requires exactly one provided '
+                   'media-type.') % (parent_type,)
 
-        return RegistryEntryWizard(component_type, type, description,
+        if err:
+            raise fxml.ParserError(err)
+
+        return RegistryEntryWizard(parent_type, type, description,
                                    feeder, eater, accepts, provides)
 
     def _parseAcceptFormat(self, node):
@@ -1084,6 +1156,18 @@
             _dump_proplist(i + ioff, cprop.getProperties())
             w(i, ('</compound-property>'))
 
+        def _dump_entries(i, entries):
+            if not entries:
+                return
+
+            w(i, '<entries>')
+            for entry in entries:
+                w(i+2, '<entry type="%s" location="%s" function="%s"/>' % (
+                    entry.getType(),
+                    entry.getLocation(),
+                    entry.getFunction()))
+            w(i, '</entries>')
+
         w(0, '<registry>')
         w(0, '')
 
@@ -1140,15 +1224,8 @@
                         file.getType()))
                 w(6, '</files>')
 
-            entries = component.getEntries()
-            if entries:
-                w(6, '<entries>')
-                for entry in entries:
-                    w(8, '<entry type="%s" location="%s" function="%s"/>' % (
-                        entry.getType(),
-                        entry.getLocation(),
-                        entry.getFunction()))
-                w(6, '</entries>')
+            _dump_entries(6, component.getEntries())
+
             w(4, '</component>')
             w(0, '')
 
@@ -1162,9 +1239,7 @@
             w(4, '<plug type="%s" socket="%s">'
               % (plug.getType(), plug.getSocket()))
 
-            entry = plug.getEntry()
-            w(6, ('<entry location="%s" function="%s"/>'
-                  % (entry.getLocation(), entry.getFunction())))
+            _dump_entries(6, plug.getEntries())
 
             w(6, '<properties>')
             _dump_proplist(8, plug.getProperties())

Modified: flumotion/trunk/flumotion/component/component.py
==============================================================================
--- flumotion/trunk/flumotion/component/component.py	(original)
+++ flumotion/trunk/flumotion/component/component.py	Fri Feb 15 19:38:55 2008
@@ -92,7 +92,7 @@
             reference.notifyOnDisconnect(remoteDisconnected)
 
         def loginFailedDisconnect(failure):
-            # We _always_ disconnect. Then, we may log a more specific failure 
+            # We _always_ disconnect. Then, we may log a more specific failure
             # message at a higher warning level.
             self.debug('Login failed, reason: %s, disconnecting', failure)
             self.disconnect()
@@ -278,7 +278,7 @@
         Instead, they should implement init(), which will be called
         by this implementation automatically.
 
-        See L{flumotion.common.common.InitMixin} for more details.
+        L{flumotion.common.common.InitMixin} for more details.
         """
         self.debug("initializing %r with config %r", type(self), config)
         self.config = config
@@ -312,10 +312,10 @@
         self.uiState.addKey('cpu-percent')
         # Time the component was started
         self.uiState.addKey('start-time')
-        # Current time at last update. 
+        # Current time at last update.
         # Provided in order to allow displaying uptime since the remote system
         # probably doesn't have a synchronised clock with this one.
-        self.uiState.addKey('current-time') 
+        self.uiState.addKey('current-time')
         # Virtual memory size in bytes
         self.uiState.addKey('virtual-size')
 
@@ -384,8 +384,9 @@
         for socket, plugs in self.config['plugs'].items():
             self.plugs[socket] = []
             for plug in plugs:
-                instance = reflectcall.reflectCall(plug['module-name'],
-                                                   plug['function-name'],
+                entry = plug['entries']['default']
+                instance = reflectcall.reflectCall(entry['module-name'],
+                                                   entry['function-name'],
                                                    plug)
                 self.plugs[socket].append(instance)
                 self.debug('Starting plug %r on socket %s',
@@ -624,13 +625,13 @@
     def _pollMemory(self):
         # Figure out our virtual memory size and report that.
         # I don't know a nicer way to find vsize than groping /proc/
-        handle = open('/proc/%d/stat' % os.getpid()) 
-        line = handle.read() 
+        handle = open('/proc/%d/stat' % os.getpid())
+        line = handle.read()
         handle.close()
-        fields = line.split() 
-        # field 1 (comm) could potentially contain spaces and thus split over 
-        # multiple list items, but our processes do not contain spaces 
-        vsize = int(fields[22]) 
-        self.log('vsize is %d', vsize) 
+        fields = line.split()
+        # field 1 (comm) could potentially contain spaces and thus split over
+        # multiple list items, but our processes do not contain spaces
+        vsize = int(fields[22])
+        self.log('vsize is %d', vsize)
         self.uiState.set('virtual-size', vsize)
 

Modified: flumotion/trunk/flumotion/component/muxers/muxers.xml
==============================================================================
--- flumotion/trunk/flumotion/component/muxers/muxers.xml	(original)
+++ flumotion/trunk/flumotion/component/muxers/muxers.xml	Fri Feb 15 19:38:55 2008
@@ -15,6 +15,7 @@
         <accept-format media-type="theora"/>
         <accept-format media-type="speex"/>
         <accept-format media-type="vorbis"/>
+        <provide-format media-type="ogg"/>
       </wizard>
     </component>
   
@@ -32,6 +33,7 @@
         <accept-format media-type="jpeg"/>
         <accept-format media-type="mulaw"/>
         <accept-format media-type="smoke"/>
+        <provide-format media-type="multipart"/>
       </wizard>
     </component>
   

Modified: flumotion/trunk/flumotion/manager/admin.py
==============================================================================
--- flumotion/trunk/flumotion/manager/admin.py	(original)
+++ flumotion/trunk/flumotion/manager/admin.py	Fri Feb 15 19:38:55 2008
@@ -190,7 +190,7 @@
 
     def perspective_getEntryByType(self, componentType, entryType):
         """
-        Get the entry point for a piece of bundled code by the type.
+        Get the entry point for a piece of bundled code in a component by type.
         @param componentType: the component
         @type componentType: a string
         @param entryType: location of the entry point
@@ -202,6 +202,7 @@
 
         self.debug('getting entry of type %s for component type %s',
                    entryType, componentType)
+
         try:
             componentRegistryEntry = registry.getRegistry().getComponent(
                 componentType)
@@ -218,6 +219,34 @@
             filename, entry.function))
         return (filename, entry.function)
 
+    def perspective_getPlugEntry(self, plugType, entryType):
+        """
+        Get the entry point for a piece of bundled code in a plug by type.
+        @param plugType: the plug
+        @type plugType: a string
+        @param entryType: location of the entry point
+        @type entryType: a string
+        Returns: a (filename, methodName) tuple, or raises::
+          - NoBundleError if the entry location does not exist
+        """
+        assert plugType is not None
+
+        self.debug('getting entry of type %s for plug type %s',
+                   entryType, plugType)
+
+        try:
+            plugRegistryEntry = registry.getRegistry().getPlug(plugType)
+            entry = plugRegistryEntry.getEntryByType(entryType)
+        except KeyError:
+            self.warning("Could not find bundle for %s(%s)" % (
+                plugType, entryType))
+            raise errors.NoBundleError("entry type %s in plug type %s" %
+                                       (entryType, plugType))
+
+        self.debug('entry point is in file path %s and function %s' % (
+           entry.location, entry.function))
+        return (entry.location, entry.function)
+
     def perspective_reloadManager(self):
         """
         Reload modules in the manager.
@@ -384,10 +413,8 @@
         @type  accepts: list of strings
         @returns: L[componentui.WizardEntryState}
         """
-        retval = []
-
-        for component in registry.getRegistry().getComponents():
-            for wizard in component.wizards:
+        def extract(wizards):
+            for wizard in wizards:
                 if types is not None:
                     if wizard.type not in types:
                         continue
@@ -403,7 +430,16 @@
                             break
                     else:
                         continue
-                retval.append(wizard)
+                yield wizard
+
+        retval = []
+        r = registry.getRegistry()
+        for component in r.getComponents():
+            retval += extract(component.wizards)
+        for plug in r.getPlugs():
+            retval += extract(plug.wizards)
+        del r
+
         return retval
 
 

Modified: flumotion/trunk/flumotion/test/test_component_bouncers_component.py
==============================================================================
--- flumotion/trunk/flumotion/test/test_component_bouncers_component.py	(original)
+++ flumotion/trunk/flumotion/test/test_component_bouncers_component.py	Fri Feb 15 19:38:55 2008
@@ -35,8 +35,9 @@
                  [{'socket': component.BOUNCER_SOCKET,
                    'type': 'trivial-bouncer-plug',
                    'properties': {},
-                   'module-name': 'flumotion.component.bouncers.plug',
-                   'function-name': 'TrivialBouncerPlug'}]}
+                   'entries': {'default': {'module-name': 'flumotion.component.bouncers.plug',
+                                           'function-name': 'TrivialBouncerPlug'}}
+                   }]}
         self.obj = component.Bouncer({'name': 'fake',
                                       'avatarId': '/default/fake',
                                       'plugs': plugs,

Modified: flumotion/trunk/flumotion/test/test_component_httpserver.py
==============================================================================
--- flumotion/trunk/flumotion/test/test_component_httpserver.py	(original)
+++ flumotion/trunk/flumotion/test/test_component_httpserver.py	Fri Feb 15 19:38:55 2008
@@ -197,9 +197,9 @@
     def _localPlug(self, plugname):
         return {
             'flumotion.component.plugs.lifecycle.ComponentLifecycle':
-            [{ 'module-name': 'flumotion.test.test_component_httpserver',
+            [{'entries': {'default':{ 'module-name': 'flumotion.test.test_component_httpserver',
               'function-name': plugname,
-              }]
+              }}}]
             }
 
     def testSetRootResource(self):

Modified: flumotion/trunk/flumotion/test/test_config.py
==============================================================================
--- flumotion/trunk/flumotion/test/test_config.py	(original)
+++ flumotion/trunk/flumotion/test/test_config.py	Fri Feb 15 19:38:55 2008
@@ -357,8 +357,9 @@
                            [{'type':'test-adminaction',
                              'socket':
                              'flumotion.component.plugs.adminaction.AdminAction',
-                             'module-name': 'qux.baz',
-                             'function-name': 'Quxulator',
+                             'entries': {'default':
+                                         {'function-name': 'Quxulator',
+                                          'module-name': 'qux.baz'}},
                              'properties': {'foo': 'bar'}}],
                            'flumotion.component.plugs.lifecycle.ManagerLifecycle':
                            [],
@@ -691,8 +692,8 @@
         self.assertEquals(foobars[0],
                           {'socket': 'foo.bar',
                            'type': 'frobulator',
-                           'function-name': 'Frobulator',
-                           'module-name': 'bar.baz',
+                           'entries': {'default':{'function-name': 'Frobulator',
+                                                  'module-name': 'bar.baz'}},
                            'properties': {'rate': (3, 4)}})
 
     def testParsePlugsWithCompoundProperties(self):
@@ -729,8 +730,8 @@
         self.assertEquals(foobars[0],
                           {'socket': 'foo.bar',
                            'type': 'compoundulator',
-                           'module-name': 'xom.baz',
-                           'function-name': 'Xombulator',
+                           'entries': {'default': {'function-name': 'Xombulator',
+                                                   'module-name': 'xom.baz'}},
                            'properties': {'cp1': [{'one': 'a string'},
                                                   {'one': 'a second string'}],
                                           'cp2': {'two': 2},
@@ -1059,7 +1060,7 @@
             conf.parse()
             cons = conf.getComponentEntries()['/default/component-name'].getConfigDict()
             self.assertEquals(cons['virtual-feeds'], feeds)
-            
+
         assertFail("""
              <planet>
                <flow name="default">
@@ -1109,7 +1110,7 @@
                </flow>
              </planet>
              """, {'valid:name': 'default'})
-        
+
 
 class TestDictDiff(testsuite.TestCase):
     def assertOND(self, d1, d2, old, new, diff):

Modified: flumotion/trunk/flumotion/test/test_registry.py
==============================================================================
--- flumotion/trunk/flumotion/test/test_registry.py	(original)
+++ flumotion/trunk/flumotion/test/test_registry.py	Fri Feb 15 19:38:55 2008
@@ -278,7 +278,9 @@
   </components>
   <plugs>
     <plug type="baz" socket="frogger">
-      <entry location="loc" function="main"/>
+      <entries>
+        <entry type="default" location="loc" function="main"/>
+      </entries>
       <properties>
         <property name="qux" type="string" description="a quxy property"/>
       </properties>
@@ -321,7 +323,9 @@
   <plugs>
 
     <plug type="baz" socket="frogger">
-      <entry location="loc" function="main"/>
+      <entries>
+        <entry type="default" location="loc" function="main"/>
+      </entries>
       <properties>
         <property name="qux" type="string"
                   description="a quxy property"
@@ -472,7 +476,9 @@
   <plugs>
 
     <plug type="baz" socket="frogger">
-      <entry location="loc" function="main"/>
+      <entries>
+        <entry type="default" location="loc" function="main"/>
+      </entries>
       <properties>
         <property name="qux" type="string"
                   description="a quxy property"

Modified: flumotion/trunk/flumotion/worker/worker.py
==============================================================================
--- flumotion/trunk/flumotion/worker/worker.py	(original)
+++ flumotion/trunk/flumotion/worker/worker.py	Fri Feb 15 19:38:55 2008
@@ -251,7 +251,8 @@
             moduleNames = [moduleName]
             for plugs in conf.get('plugs', {}).values():
                 for plug in plugs:
-                    moduleNames.append(plug['module-name'])
+                    for entry in plug.get('entries', {}).values():
+                        moduleNames.append(entry['module-name'])
             self.debug('setting up bundles for %r', moduleNames)
             return self.medium.bundleLoader.getBundles(moduleName=moduleNames)
 


More information about the flumotion-commit mailing list