Reconfig objects

reconfigure.config.Reconfig objects are pre-set pipelines connecting Parsers, Includers and Builders

Reconfigure comes with many Reconfig objects out-of-the-box - see reconfigure.configs

Writing your Reconfig subclass

Use the following pattern:

class <name>Config (Reconfig):
    """
    <description>
    """

    def __init__(self, **kwargs):
        k = {
            'parser': <parser-class>(),
            'includer': <includer-class>(),
            'builder': BoundBuilder(<root-data-class>),
        }
        k.update(kwargs)
        Reconfig.__init__(self, **k)

Example:

class SupervisorConfig (Reconfig):
    """
    ``/etc/supervisor/supervisord.conf``
    """

    def __init__(self, **kwargs):
        k = {
            'parser': IniFileParser(),
            'includer': SupervisorIncluder(),
            'builder': BoundBuilder(SupervisorData),
        }
        k.update(kwargs)
        Reconfig.__init__(self, **k)

Table Of Contents

Previous topic

Components

Next topic

reconfigure.configs

This Page