equal
deleted
inserted
replaced
358 """Loads the configuration, read only. |
358 """Loads the configuration, read only. |
359 |
359 |
360 Raises a ConfigError if the configuration syntax is |
360 Raises a ConfigError if the configuration syntax is |
361 invalid. |
361 invalid. |
362 """ |
362 """ |
|
363 self._cfg_file = open(self._cfg_filename, 'r') |
363 try: |
364 try: |
364 self._cfg_file = open(self._cfg_filename, 'r') |
|
365 self.readfp(self._cfg_file) |
365 self.readfp(self._cfg_file) |
366 except (MissingSectionHeaderError, ParsingError), err: |
366 except (MissingSectionHeaderError, ParsingError), err: |
367 raise ConfigError(str(err), CONF_ERROR) |
367 raise ConfigError(str(err), CONF_ERROR) |
368 finally: |
368 self._cfg_file.close() |
369 if self._cfg_file and not self._cfg_file.closed: |
|
370 self._cfg_file.close() |
|
371 |
369 |
372 def check(self): |
370 def check(self): |
373 """Performs a configuration check. |
371 """Performs a configuration check. |
374 |
372 |
375 Raises a ConfigError if settings w/o a default value are missed. |
373 Raises a ConfigError if settings w/o a default value are missed. |