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