From 00be52d4097dd5b4d35d50b102bfab824680c188 Mon Sep 17 00:00:00 2001 From: Matthijs Kooijman Date: Thu, 10 Jun 2010 14:21:19 +0200 Subject: [PATCH] handlers: Add **kwargs to Handler methods. This allows for easy addition of extra parameters later on. --- src/lib/backupninja/handlers/__init__.py | 4 ++-- src/lib/backupninja/handlers/test.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib/backupninja/handlers/__init__.py b/src/lib/backupninja/handlers/__init__.py index 7603afd..fb57bf4 100644 --- a/src/lib/backupninja/handlers/__init__.py +++ b/src/lib/backupninja/handlers/__init__.py @@ -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. diff --git a/src/lib/backupninja/handlers/test.py b/src/lib/backupninja/handlers/test.py index 4676ce3..ce32c89 100644 --- a/src/lib/backupninja/handlers/test.py +++ b/src/lib/backupninja/handlers/test.py @@ -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 -- 2.30.2