reconfigure.includers

class reconfigure.includers.BaseIncluder(parser=None, content_map={})[source]

A base includer class

Parameters:
  • parser – Parser instance that was used to parse the root config file
  • content_map – a dict that overrides config content for specific paths
compose(origin, tree)[source]

Should locate the include nodes in the Node tree, replace them with reconfigure.nodes.IncludeNode, parse the specified include files and append them to tree, with correct node origin attributes

decompose(origin, tree)[source]

Should detach the included subtrees from the Node tree and return a { origin: content-node-tree } dict.

class reconfigure.includers.AutoIncluder(parser=None, content_map={})[source]

This base includer automatically walks the node tree and loads the include files from IncludeNode.files properties. files is supposed to contain absolute path, relative path or a shell wildcard.

compose(origin, tree)[source]
compose_rec(root, origin, node)[source]
decompose(tree)[source]
decompose_rec(node, result)[source]
is_include(node)[source]

Should return whether the node is an include node and return file pattern glob if it is

remove_include(node)[source]

Shoud transform reconfigure.nodes.IncludeNode into a normal Node to be stringified into the file

class reconfigure.includers.BIND9Includer(parser=None, content_map={})[source]
is_include(node)[source]
remove_include(node)[source]
class reconfigure.includers.NginxIncluder(parser=None, content_map={})[source]
is_include(node)[source]
remove_include(node)[source]
class reconfigure.includers.SupervisorIncluder(parser=None, content_map={})[source]
is_include(node)[source]
remove_include(node)[source]