Python API

Homer Python API autodoc.

Homer package.

class homer.Homer(main_config: Mapping)[source]

Bases: object

The instance to run Homer.

Initialize the instance.

Parameters

main_config (dict) -- the configuration dictionary.

OUT_EXTENSION = '.out'

the extension for the generated output files.

Type

str

commit(query: str, *, message: str = '-') → int[source]

Commit the generated configuration asking for confirmation.

Parameters
  • query (str) -- the query to select the devices.

  • message (str) -- the commit message to use.

Returns

0 on success, a small positive integer on failure.

Return type

int

diff(query: str) → int[source]

Generate the configuration and check the diff with the current live one.

Parameters

query (str) -- the query to select the devices.

Returns

0 on success, a small positive integer on failure.

Return type

int

generate(query: str) → int[source]

Generate the configuration only saving it locally, no remote action is performed.

Parameters

query (str) -- the query to select the devices.

Returns

0 on success, a small positive integer on failure.

Return type

int

homer.__version__ = '0.1.dev2+g247a636'

the version of the current Homer package.

Type

str

Subpackages and Submodules