output.output_factory module

class output.output_factory.OutputFactory

Bases: object

Factory class for creating Output instances.

Add an entry "MyOutput": lambda s: MyOutput(s) in SUPPORTED_SUBCLASSES for the factory to recognize your own implementation.

SUPPORTED_SUBCLASSES = {'DummyOutput': <function OutputFactory.<lambda>>, 'output_best_area': <function OutputFactory.<lambda>>}
static factory(cfg_file)

Parses the Method parameter from the configuration file and returns the corresponding subclass instance if supported.

Parameters:cfg_file (str) – The absolute path to the configuration file in *.cfg format.
Returns:An instance of the Output subclass specified by the Method parameter in the configuration file’s Output section.
Return type:Output
Raises:NotImplementedError – If the subclass ID from the configuration file cannot be recognized.