front_end.front_end_factory module

class front_end.front_end_factory.FrontEndFactory

Bases: object

Factory class for creating FrontEnd instances.

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

SUPPORTED_SUBCLASSES = {'AnnotatedCandidates': <function FrontEndFactory.<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 FrontEnd subclass specified by the Method parameter in the configuration file’s FrontEnd section.
Return type:FrontEnd
Raises:NotImplementedError – If the subclass ID from the configuration file cannot be recognized.