Package flumotion :: Package common :: Module config
[hide private]

Module config

source code

parsing of configuration files

Classes [hide private]
  ConfigEntryPlug
I represent a <plug> entry in a planet config file
  ConfigEntryComponent
I represent a <component> entry in a planet config file
  ConfigEntryFlow
I represent a <flow> entry in a planet config file
  ConfigEntryManager
I represent a <manager> entry in a planet config file
  ConfigEntryAtmosphere
I represent a <atmosphere> entry in a planet config file
  BaseConfigParser
  FlumotionConfigXML
I represent a planet configuration file for Flumotion.
  ManagerConfigParser
I parse manager configuration out of a planet configuration file.
  AdminConfigParser
Admin configuration file parser.
Functions [hide private]
 
_ignore(*args) source code
 
upgradeEaters(conf) source code
 
upgradeAliases(conf) source code
 
buildEatersDict(eatersList, eaterDefs)
Build a eaters dict suitable for forming part of a component config.
source code
 
parsePropertyValue(propName, type, value) source code
 
parseCompoundPropertyValue(name, definition, value) source code
 
buildPropertyDict(propertyList, propertySpecList)
Build a property dict suitable for forming part of a component config.
source code
 
buildPlugsSet(plugsList, sockets)
Build a plugs dict suitable for forming part of a component config.
source code
 
buildVirtualFeeds(feedPairs, feeders)
Build a virtual feeds dict suitable for forming part of a component config.
source code
 
dictDiff(old, new, onlyOld=None, onlyNew=None, diff=None, keyBase=None)
Compute the difference between two config dicts.
source code
 
dictDiffMessageString((old, new, diff), oldLabel='old', newLabel='new') source code
 
exportPlanetXml(p) source code
Variables [hide private]
  UPGRADERS = [upgradeEaters, upgradeAliases]
  CURRENT_VERSION = 2
Function Details [hide private]

buildEatersDict(eatersList, eaterDefs)

source code 

Build a eaters dict suitable for forming part of a component config.

Parameters:
  • eatersList (List of (eaterName, feedId, eaterAlias?)) - List of eaters. For example, [('default', 'othercomp:feeder', 'foo')] says that our eater 'default' will be fed by the feed identified by the feedId 'othercomp:feeder', and that it has the alias 'foo'. Alias is optional.
  • eaterDefs (List of flumotion.common.registry.RegistryEntryEater) - The set of allowed and required eaters
Returns:
Dict of eaterName => [(feedId, eaterAlias)]

buildPropertyDict(propertyList, propertySpecList)

source code 

Build a property dict suitable for forming part of a component config.

Parameters:
  • propertyList (List of (name, value)) - List of property name-value pairs. For example, [('foo', 'bar'), ('baz', 3)] defines two property-value pairs. The values will be parsed into the appropriate types, this it is allowed to pass the string '3' for an int value.
  • propertySpecList (List of flumotion.common.registry.RegistryEntryProperty) - The set of allowed and required properties

buildPlugsSet(plugsList, sockets)

source code 

Build a plugs dict suitable for forming part of a component config.

Parameters:
  • plugsList (List of (type, propertyList)) - List of plugs, as type-propertyList pairs. For example, [('frag', [('foo', 'bar')])] defines a plug of type 'frag', and the propertyList representing that plug's properties. The properties will be validated against the plug's properties as defined in the registry.
  • sockets (List of str) - The set of allowed sockets

buildVirtualFeeds(feedPairs, feeders)

source code 

Build a virtual feeds dict suitable for forming part of a component config.

Parameters:
  • feedPairs (List of (feedId, feedName) -- both strings.) - List of virtual feeds, as name-feederName pairs. For example, [('bar:baz', 'qux')] defines one virtual feed 'bar:baz', which is provided by the component's 'qux' feed.
  • feeders (List of str.) - The feeders exported by this component, from the registry.

dictDiff(old, new, onlyOld=None, onlyNew=None, diff=None, keyBase=None)

source code 

Compute the difference between two config dicts.

Returns:
3 tuple: (onlyOld, onlyNew, diff) where: onlyOld is a list of (key, value), representing key-value pairs that are only in old; onlyNew is a list of (key, value), representing key-value pairs that are only in new; diff is a list of (key, oldValue, newValue), representing keys with different values in old and new; and key is a tuple of strings representing the recursive key to get to a value. For example, ('foo', 'bar') represents the value d['foo']['bar'] on a dict d.