Did I find the right examples for you? yes no

All Samples(1)  |  Call(0)  |  Derive(0)  |  Import(1)
Imports values from source into target.

Recursively walks the <source> ConfigNamespace and inserts values
into the <target> ConfigNamespace.  For example:

>>> n = BasicConfig()
>>> n.playlist.expand_playlist = True
>>> n.ui.display_clock = True
>>> n.ui.display_qlength = True
>>> n.ui.width = 150(more...)

        def update_config(target, source):
    """Imports values from source into target.

    Recursively walks the  ConfigNamespace and inserts values
    into the  ConfigNamespace.  For example:

    >>> n = BasicConfig()
    >>> n.playlist.expand_playlist = True
    >>> n.ui.display_clock = True
    >>> n.ui.display_qlength = True
    >>> n.ui.width = 150
    >>> print n
    playlist.expand_playlist = True
    ui.display_clock = True
    ui.display_qlength = True
    ui.width = 150

    >>> from iniparse import ini
    >>> i = ini.INIConfig()
    >>> update_config(i, n)
    >>> print i
    [playlist]
    expand_playlist = True
    
    [ui]
    display_clock = True
    display_qlength = True
    width = 150

    """
    for name in source:
        value = source[name]
        if isinstance(value, ConfigNamespace):
            try:
                myns = target[name]
                if not isinstance(myns, ConfigNamespace):
                    raise TypeError('value-namespace conflict')
            except KeyError:
                myns = target._new_namespace(name)
            update_config(myns, value)
        else:
            target[name] = value
        


src/h/o/holland-HEAD/plugins/holland.backup.mysqldump/holland/backup/mysqldump/util/__init__.py   holland(Download)
 
from ini import INIConfig
from config import BasicConfig, ConfigNamespace, update_config
from compat import RawConfigParser, ConfigParser, SafeConfigParser