handlers: Add **kwargs to Handler methods.
[matthijs/projects/backupninja.git] / src / lib / backupninja / handlers / __init__.py
index 990c4717a860d1c48d5c02c4716f37d5fca17b5c..fb57bf43f01622000622a0c21f71056919bf9c70 100644 (file)
@@ -26,14 +26,14 @@ class Handler(object):
     def __init__(self, conf):
         self.conf = conf
 
-    def run(self):
+    def run(self, **kwargs):
         """
         Run this handler for a single target. Override this method
         in a subclass
         """
         pass
 
-    def finish(self):
+    def finish(self, **kwargs):
         """
         Called when all targets have been processed. Can be overridden
         in a subclass.
@@ -50,12 +50,14 @@ def create_handler(ty, conf):
     modname = 'backupninja.handlers.%s' % ty
     # Load the handler if it is not loaded yet
     if not modname in sys.modules:
+        log.debug('Loading handler for type "%s"', ty)
         try:
             __import__(modname, globals(), locals(), [])
         except ImportError, e:
             # Add some extra info, since the default exception does not
             # show the full module name.
             raise ImportError('Cannot load module %s: %s' % (modname, e))
+        log.debug('Loaded handler for type "%s" from "%s"', ty, sys.modules[modname].__file__)
     # Get the module from the module table
     module = sys.modules[modname]