projects
/
matthijs
/
projects
/
backupninja.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
8864a7d
)
handlers: Make create_action pass any kwargs to the constructor.
author
Matthijs Kooijman
<matthijs@stdin.nl>
Sat, 7 Aug 2010 19:37:38 +0000
(21:37 +0200)
committer
Matthijs Kooijman
<matthijs@stdin.nl>
Sat, 7 Aug 2010 19:37:38 +0000
(21:37 +0200)
src/lib/backupninja/handlers/__init__.py
patch
|
blob
|
history
diff --git
a/src/lib/backupninja/handlers/__init__.py
b/src/lib/backupninja/handlers/__init__.py
index 484677171e0e72ec57250bbdfeaf3b554acf226e..50abb41307c9078444200c86c731e9de284a1cb7 100644
(file)
--- a/
src/lib/backupninja/handlers/__init__.py
+++ b/
src/lib/backupninja/handlers/__init__.py
@@
-107,10
+107,11
@@
class Action(object):
except ConfigParser.NoOptionError:
raise config.ConfigError("Option '%s' in section '%s' is mandatory, please configure it" % (option, section))
except ConfigParser.NoOptionError:
raise config.ConfigError("Option '%s' in section '%s' is mandatory, please configure it" % (option, section))
-def create_action(ty):
+def create_action(ty
, **kwargs
):
"""
Create a new (subclass of) Action object for an action with the
"""
Create a new (subclass of) Action object for an action with the
- given type.
+ given type. Any extra keyword arguments are passed to the
+ constructor.
If the handler class for this type cannot be loaded, an exception is
thrown.
If the handler class for this type cannot be loaded, an exception is
thrown.
@@
-137,7
+138,7
@@
def create_action(ty):
% (module.__file__))
# Call the "handler" function to create the actual action
% (module.__file__))
# Call the "handler" function to create the actual action
- action = module.handler()
+ action = module.handler(
**kwargs
)
# Check if the handler returned is really a subclass of Action
if not isinstance(action, Action):
# Check if the handler returned is really a subclass of Action
if not isinstance(action, Action):