Package flumotion :: Package launch :: Module parse
[hide private]

Module parse

source code

flumotion.launch.parse: A parsing library for flumotion-launch syntax.


Version: $Rev$

Classes [hide private]
  Component
  ComponentStore
  Linker
Functions [hide private]
 
err(x) source code
 
parse_plug(arg) source code
 
parse_props(props)
Splits a property line respecting compound properties.
source code
 
parse_prop(arg)
Parses a property.
source code
 
sloppy_unescape(value, escaped, escape='\\')
Permissively unescapes a string.
source code
 
parse_arg(arg, components, linker) source code
 
parse_args(args)
Parse flumotion-launch arguments.
source code
Variables [hide private]
  __package__ = 'flumotion.launch'
Function Details [hide private]

parse_props(props)

source code 

Splits a property line respecting compound properties.
Ex:    a1=[c1=d1,c2=[e1=[g1=h1],e2=f2]],a2=b2
    -> [("a1", [("c1", "d1"),
                ("c2", [("e1", [("g1", "h1")]),
                        ("e2", "f2")])],
        ("a2", "b2")]

parse_prop(arg)

source code 

Parses a property. Supports compounds properties.

sloppy_unescape(value, escaped, escape='\\')

source code 

Permissively unescapes a string.

Examples with \ as escape character,
E as escaped character and X as a non-escaped character:
    X -> X
    \E -> E
    \ ->         \X -> \X
    X\ -> X        E\ -> E        \\E -> \E
    \\X -> \X

parse_args(args)

source code 

Parse flumotion-launch arguments.

Parse flumotion-launch arguments, returning a list of component configs.

A component config is what we will pass to a component when we create it. It is a dict:

  • 'name': component name
  • 'type': component type
  • 'properties': dict of property name => property value
  • 'feed': list of [feeder name,...]
  • 'source': list of [feeder name,...], (optional)
  • 'clock-master': clock master or None
  • 'plugs': dict of socket name => plug config