def __init__(self, settings, index_title=''):
        self.settings = settings
        self.output_dir = settings['destination']
        self.theme = settings['theme']
        self.index_title = index_title
        self.logger = logging.getLogger(__name__)

        # search the theme in sigal/theme if the given one does not exists
        if not os.path.exists(self.theme) or \
                not os.path.exists(os.path.join(self.theme, 'templates')):
            self.theme = os.path.join(THEMES_PATH, self.theme)
            if not os.path.exists(self.theme):
                raise Exception("Impossible to find the theme %s" % self.theme)

        self.logger.info("Theme  : %s", self.theme)
        theme_relpath = os.path.join(self.theme, 'templates')
        default_loader = FileSystemLoader(os.path.join(THEMES_PATH, 'default',
                                                       'templates'))

        # setup jinja env
        env_options = {'trim_blocks': True, 'autoescape': True}
        try:
            if (2, 7) >= tuple(int(x) for x in jinja2.__version__.split('.')):
                env_options['lstrip_blocks'] = True
        except ValueError:
            pass

        env = Environment(
            loader=ChoiceLoader([
                FileSystemLoader(theme_relpath),
                default_loader,  # implicit inheritance
                PrefixLoader({'!default': default_loader})  # explicit one
            ]),
            **env_options
        )

        try:
            self.template = env.get_template(self.template_file)
        except TemplateNotFound:
            self.logger.error('The index.html template was not found.')
            sys.exit(1)

        # Copy the theme files in the output dir
        self.theme_path = os.path.join(self.output_dir, 'static')
        copy_tree(os.path.join(self.theme, 'static'), self.theme_path)
dataset/ETHPy150Open saimn/sigal/sigal/writer.py/Writer.__init__/swapped operands of `>=`