Merge branch 'master' of github.com:Kozea/radicale
This commit is contained in:
		| @@ -28,6 +28,7 @@ import os | |||||||
| import sys | import sys | ||||||
| import logging | import logging | ||||||
| import logging.config | import logging.config | ||||||
|  | import signal | ||||||
|  |  | ||||||
| from . import config | from . import config | ||||||
|  |  | ||||||
| @@ -35,6 +36,14 @@ from . import config | |||||||
| LOGGER = logging.getLogger() | LOGGER = logging.getLogger() | ||||||
|  |  | ||||||
|  |  | ||||||
|  | def configure_from_file(filename, debug): | ||||||
|  |     logging.config.fileConfig(filename) | ||||||
|  |     if debug: | ||||||
|  |         LOGGER.setLevel(logging.DEBUG) | ||||||
|  |         for handler in LOGGER.handlers: | ||||||
|  |             handler.setLevel(logging.DEBUG) | ||||||
|  |  | ||||||
|  |  | ||||||
| def start(): | def start(): | ||||||
|     """Start the logging according to the configuration.""" |     """Start the logging according to the configuration.""" | ||||||
|     filename = os.path.expanduser(config.get("logging", "config")) |     filename = os.path.expanduser(config.get("logging", "config")) | ||||||
| @@ -42,11 +51,11 @@ def start(): | |||||||
|  |  | ||||||
|     if os.path.exists(filename): |     if os.path.exists(filename): | ||||||
|         # Configuration taken from file |         # Configuration taken from file | ||||||
|         logging.config.fileConfig(filename) |         configure_from_file(filename, debug) | ||||||
|         if debug: |         # Reload config on SIGHUP | ||||||
|             LOGGER.setLevel(logging.DEBUG) |         def handler(signum, frame): | ||||||
|             for handler in LOGGER.handlers: |             configure_from_file(filename, debug) | ||||||
|                 handler.setLevel(logging.DEBUG) |         signal.signal(signal.SIGHUP, handler) | ||||||
|     else: |     else: | ||||||
|         # Default configuration, standard output |         # Default configuration, standard output | ||||||
|         handler = logging.StreamHandler(sys.stdout) |         handler = logging.StreamHandler(sys.stdout) | ||||||
|   | |||||||
| @@ -60,6 +60,7 @@ class Collection(filesystem.Collection): | |||||||
|  |  | ||||||
|     def delete(self): |     def delete(self): | ||||||
|         shutil.rmtree(self._path) |         shutil.rmtree(self._path) | ||||||
|  |         os.remove(self._props_path) | ||||||
|  |  | ||||||
|     def remove(self, name): |     def remove(self, name): | ||||||
|         if os.path.exists(os.path.join(self._path, name)): |         if os.path.exists(os.path.join(self._path, name)): | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Guillaume Ayoub
					Guillaume Ayoub