def start_up(self, env, mod_config):
    for timespan in mod_config.force_close_time:
        v = timespan.split('-')
        assert (len(v) == 2), ('%s invalid' % mod_config.force_close_time)
        start_time_v = v[0].split(':')
        end_time_v = v[1].split(':')
        assert (len(start_time_v) == 2), ('%s invalid' % mod_config.force_close_time)
        assert (len(end_time_v) == 2), ('%s invalid' % mod_config.force_close_time)
        self._force_close_time.append({'start': {'hour': int(start_time_v[0]), 'minute': int(start_time_v[1])}, 'end': {'hour': int(end_time_v[0]), 'minute': int(end_time_v[1])}})
    if ('log_dir' in mod_config.keys()):
        self._log_dir = mod_config.log_dir
        if (os.path.exists(self._log_dir) is False):
            os.makedirs(self._log_dir)
    env.event_bus.prepend_listener(EVENT.BAR, self._check_force_close)
def start_up(self, env, mod_config):
    for timespan in mod_config.force_close_time:
        v = timespan.split('-')
        assert (len(v) == 2), ('%s invalid' % mod_config.force_close_time)
        start_time_v = v[0].split(':')
        end_time_v = v[1].split(':')
        assert (len(start_time_v) == 2), ('%s invalid' % mod_config.force_close_time)
        assert (len(end_time_v) == 2), ('%s invalid' % mod_config.force_close_time)
        self._force_close_time.append({'start': {'hour': int(start_time_v[0]), 'minute': int(start_time_v[1])}, 'end': {'hour': int(end_time_v[0]), 'minute': int(end_time_v[1])}})
    if ('log_dir' in mod_config.keys()):
        self._log_dir = mod_config.log_dir
        if (os.path.exists(self._log_dir) is False):
            os.makedirs(self._log_dir)
    env.event_bus.prepend_listener(EVENT.BAR, self._check_force_close)