Example #1
0
    def _buildConfig(self, propertyList, plugsList, eatersList, isClockMaster,
                     project, version, virtualFeeds):
        """
        Build a component configuration dictionary.
        """
        # clock-master should be either an avatar id or None.
        # It can temporarily be set to True, and the flow parsing
        # code will change it to the avatar id or None.
        config = {
            'name':
            self.name,
            'parent':
            self.parent,
            'type':
            self.type,
            'config-version':
            CURRENT_VERSION,
            'avatarId':
            common.componentId(self.parent, self.name),
            'project':
            project or configure.PACKAGE,
            'version':
            self._buildVersionTuple(version),
            'clock-master':
            isClockMaster or None,
            'feed':
            self.defs.getFeeders(),
            'properties':
            fluconfig.buildPropertyDict(propertyList,
                                        self.defs.getProperties()),
            'plugs':
            fluconfig.buildPlugsSet(plugsList, self.defs.getSockets()),
            'eater':
            buildEatersDict(eatersList, self.defs.getEaters()),
            'source': [tup[1] for tup in eatersList],
            'virtual-feeds':
            buildVirtualFeeds(virtualFeeds or [], self.defs.getFeeders())
        }

        if self.label:
            # only add a label attribute if it was specified
            config['label'] = self.label

        if not config['source']:
            # preserve old behavior
            del config['source']
        # FIXME: verify that config['project'] matches the defs

        return config
Example #2
0
    def _buildConfig(self, propertyList, plugsList, eatersList,
                     isClockMaster, project, version, virtualFeeds):
        """
        Build a component configuration dictionary.
        """
        # clock-master should be either an avatar id or None.
        # It can temporarily be set to True, and the flow parsing
        # code will change it to the avatar id or None.
        config = {'name': self.name,
                  'parent': self.parent,
                  'type': self.type,
                  'config-version': CURRENT_VERSION,
                  'avatarId': common.componentId(self.parent, self.name),
                  'project': project or configure.PACKAGE,
                  'version': self._buildVersionTuple(version),
                  'clock-master': isClockMaster or None,
                  'feed': self.defs.getFeeders(),
                  'properties': fluconfig.buildPropertyDict(propertyList,
                                                  self.defs.getProperties()),
                  'plugs': fluconfig.buildPlugsSet(plugsList,
                                         self.defs.getSockets()),
                  'eater': buildEatersDict(eatersList,
                                           self.defs.getEaters()),
                  'source': [tup[1] for tup in eatersList],
                  'virtual-feeds': buildVirtualFeeds(virtualFeeds or [],
                                                     self.defs.getFeeders())}

        if self.label:
            # only add a label attribute if it was specified
            config['label'] = self.label

        if not config['source']:
            # preserve old behavior
            del config['source']
        # FIXME: verify that config['project'] matches the defs

        return config
Example #3
0
 def parseplugs(node):
     return fluconfig.buildPlugsSet(self.parsePlugs(node),
                          self.plugs.keys())
Example #4
0
 def parseplugs(node):
     return fluconfig.buildPlugsSet(self.parsePlugs(node),
                                    self.MANAGER_SOCKETS)
Example #5
0
 def parseplugs(node):
     return fluconfig.buildPlugsSet(self.parsePlugs(node),
                                    self.plugs.keys())
Example #6
0
 def parseplugs(node):
     return fluconfig.buildPlugsSet(self.parsePlugs(node),
                                    self.MANAGER_SOCKETS)