def __init__(self, directory, jinja2_environment, logger=None, raise_exception_on_warning=False):
super(Generator, self).__init__()<EOL>self.__logger = logger<EOL>self.__raise_exception_on_warning = raise_exception_on_warning<EOL>if not os.path.isdir(directory):<EOL><INDENT>self.log_error('<STR_LIT>' % directory)<EOL><DEDENT>self.__root_directory = os.path.abspath(directory)   <EOL>self.__jinja2_environment = jinja2_environment<EOL>self.__jinja2_predefined_filters = self.__jinja2_environment.filters.keys()<EOL>self.__extensions = {}<EOL>self.__actions = TreeMap()<EOL>self.__default_action = None<EOL>
Constructor of a :program:`cygenja` template machine.

Args:
    directory (str): Absolute or relative base directory. Everything happens in that directory and sub-directories.
    jinja2_environment: :program:`Jinja2` environment.
    logger: A logger (from the standard ``logging``) or ``None`` is no logging is wanted.
    raise_exception_on_warning (bool): If set to ``True``, raise a ``RuntimeError`` when logging a warning.