summary |
shortlog | log |
commit |
commitdiff |
tree
first ⋅ prev ⋅ next
Matthijs Kooijman [Sat, 7 Aug 2010 19:37:38 +0000 (21:37 +0200)]
handlers: Make create_action pass any kwargs to the constructor.
Matthijs Kooijman [Sat, 7 Aug 2010 19:09:20 +0000 (21:09 +0200)]
log: Make the log_exception support a per instance logger.
Previously, the logger to use was always passed to the decorator
directly, thus it must be known at class-definition time. Now, the
decorator supports not being passed a logger, in which case it will
assume the decorated function is a method on an object that has a "log"
attribute.
Matthijs Kooijman [Sat, 7 Aug 2010 18:53:20 +0000 (20:53 +0200)]
Action: store a logger object in each Action.
This will allow log messages to include the action they originate from
in the future.
Matthijs Kooijman [Sat, 7 Aug 2010 18:48:53 +0000 (20:48 +0200)]
handlers: Add fail_on_exception handler.
This decorator is meant for methods on Action subclasses and records
failure when the decorated method throws an exception.
Matthijs Kooijman [Sat, 7 Aug 2010 18:46:22 +0000 (20:46 +0200)]
log: Add log_exception decorator.
This decorator catches, logs and swallows exceptions thrown in the
decorated function.
Matthijs Kooijman [Sat, 7 Aug 2010 18:38:25 +0000 (20:38 +0200)]
action: Let each action track a status and log it.
This allows (in the future) for a nice summary after each run and allows
actions to fail without breaking out with an exception right away.
Matthijs Kooijman [Fri, 6 Aug 2010 16:24:14 +0000 (18:24 +0200)]
Action: Add config accessor functions.
These convenience functions allow for accessing configuration values
either allowing them to be unset (and return None) or mandatory (and
throw an appropriate exception). By default, ConfigParser throws an
exception with a less appropriate exception.
Matthijs Kooijman [Fri, 6 Aug 2010 16:22:46 +0000 (18:22 +0200)]
config: Allow specifying configuration values with no default.
By specifying a default of None, a config value will have no default. We
could just leave out the value alltogether, but this way even values
without a default are "documented" (this will be extended later).
Matthijs Kooijman [Mon, 26 Jul 2010 17:18:41 +0000 (19:18 +0200)]
handlers: Rename Handler class to Action.
Since instances of this class are really actions, not handlers that can
handle multiple actions, the name Action seems more appropriate (note
that the class itself could be seen as a handler, just not its
instances).
Matthijs Kooijman [Mon, 26 Jul 2010 17:04:03 +0000 (19:04 +0200)]
config: Restructure config loading to allow defaults.
Handlers now load their own configuration files, so they can pass
default configuration values. This also allows for more complicated
configuration loading in handlers by overriding the load_config method.
Matthijs Kooijman [Mon, 26 Jul 2010 16:50:28 +0000 (18:50 +0200)]
config: Remove unused variables.
These variables got unused in commit:
b99a9b8 Add commandline options for configuration files.
Matthijs Kooijman [Thu, 10 Jun 2010 13:35:49 +0000 (15:35 +0200)]
actions: Print a traceback on failed actions in debug mode.
Matthijs Kooijman [Thu, 10 Jun 2010 13:13:44 +0000 (15:13 +0200)]
config: Check action config filenames more strictly.
Previously, the filename was split at the first dot, now it can only
contain just one dot. Also fix the error message to actually include the
faulty filename.
Matthijs Kooijman [Thu, 10 Jun 2010 13:12:06 +0000 (15:12 +0200)]
config: Skip action configs starting with a dot.
This prevents hidden files (like vim swapfiles) from being treated as a
config file.
Matthijs Kooijman [Thu, 10 Jun 2010 12:23:20 +0000 (14:23 +0200)]
main: Add --test option for a dry run.
Matthijs Kooijman [Thu, 10 Jun 2010 12:21:19 +0000 (14:21 +0200)]
handlers: Add **kwargs to Handler methods.
This allows for easy addition of extra parameters later on.
Matthijs Kooijman [Thu, 10 Jun 2010 07:11:32 +0000 (09:11 +0200)]
misc: Add some extra info and debug statements.
Matthijs Kooijman [Thu, 10 Jun 2010 07:10:55 +0000 (09:10 +0200)]
main: Add --debug option to increase verbosity.
Matthijs Kooijman [Thu, 10 Jun 2010 07:00:01 +0000 (09:00 +0200)]
Add commandline options for configuration files.
Matthijs Kooijman [Thu, 10 Jun 2010 06:54:42 +0000 (08:54 +0200)]
actions: Handle OSErrors when listing action configs.
Matthijs Kooijman [Thu, 10 Jun 2010 06:28:38 +0000 (08:28 +0200)]
actions: Handle exceptions thrown by create_handler.
Matthijs Kooijman [Thu, 10 Jun 2010 06:28:26 +0000 (08:28 +0200)]
handlers: Make create_handler throw exceptions on errors.
Matthijs Kooijman [Thu, 10 Jun 2010 06:26:07 +0000 (08:26 +0200)]
actions: Sort actions before running them.
Matthijs Kooijman [Thu, 10 Jun 2010 06:18:29 +0000 (08:18 +0200)]
actions: Catch and log exceptions when running handlers.
Matthijs Kooijman [Thu, 10 Jun 2010 06:07:44 +0000 (08:07 +0200)]
test: Log at INFO instead of ERROR.
Matthijs Kooijman [Thu, 10 Jun 2010 06:07:08 +0000 (08:07 +0200)]
log: Set default logging level to INFO.
Matthijs Kooijman [Mon, 17 May 2010 17:05:24 +0000 (19:05 +0200)]
handlers: Add a .test handler.
This is a very simple Hello, world handler, which simply logs a
configurable message.
Matthijs Kooijman [Mon, 17 May 2010 17:04:42 +0000 (19:04 +0200)]
main: Make the backupninja script run all actions.
Matthijs Kooijman [Mon, 17 May 2010 17:04:28 +0000 (19:04 +0200)]
main: Add action loading and running infrastructure.
Matthijs Kooijman [Mon, 17 May 2010 17:01:36 +0000 (19:01 +0200)]
misc: Make git ignore .pyc files.
Matthijs Kooijman [Tue, 11 May 2010 19:18:13 +0000 (21:18 +0200)]
main: Add backupninja.handlers package.
Matthijs Kooijman [Tue, 11 May 2010 19:06:56 +0000 (21:06 +0200)]
main: Add configuration infrastructure.
Matthijs Kooijman [Tue, 11 May 2010 19:06:16 +0000 (21:06 +0200)]
main: Add logging infrastructure.
Matthijs Kooijman [Tue, 11 May 2010 19:17:35 +0000 (21:17 +0200)]
main: Add "backupninja" package.
Matthijs Kooijman [Wed, 5 May 2010 16:46:15 +0000 (18:46 +0200)]
main: Add (nearly empty) initial script.