handlers: Add **kwargs to Handler methods.
authorMatthijs Kooijman <matthijs@stdin.nl>
Thu, 10 Jun 2010 12:21:19 +0000 (14:21 +0200)
committerMatthijs Kooijman <matthijs@stdin.nl>
Thu, 10 Jun 2010 12:22:22 +0000 (14:22 +0200)
This allows for easy addition of extra parameters later on.

src/lib/backupninja/handlers/__init__.py
src/lib/backupninja/handlers/test.py

index 7603afd0a1bfbe3c29cb1bed2c101cfe9514dcd9..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.
index 4676ce352d0ae6aeb190b29fac488d57e9c05f35..ce32c893962be6ae70077c5c3d0b691df725c461 100644 (file)
@@ -26,7 +26,7 @@ import logging as log
 from backupninja.handlers import Handler
 
 class TestHandler(Handler):
-    def run(self):
+    def run(self, **kwargs):
         log.info(self.conf.get('main', 'message'))
         
 handler = TestHandler