diff options
author | Lars Wirzenius <lars.wirzenius@codethink.co.uk> | 2012-07-05 16:12:20 +0100 |
---|---|---|
committer | Lars Wirzenius <lars.wirzenius@codethink.co.uk> | 2012-07-05 16:12:20 +0100 |
commit | 48e5342f88a4c6fdead03b62b89146e851c23742 (patch) | |
tree | 25fba0f25aa6d6cc1e3da60080420cb377788588 /morphlib | |
parent | ad6cae07ae5320abd44b35e06a9a241c273bafe4 (diff) | |
download | morph-48e5342f88a4c6fdead03b62b89146e851c23742.tar.gz |
Add a hook for creating a BuildCommand instance
This will allow plugins to override the BuildCommand with their own
instance.
Diffstat (limited to 'morphlib')
-rwxr-xr-x | morphlib/app.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/morphlib/app.py b/morphlib/app.py index c588f381..5d5a2039 100755 --- a/morphlib/app.py +++ b/morphlib/app.py @@ -458,6 +458,9 @@ class Morph(cliapp.Application): cliapp.Application.setup_plugin_manager(self) s = os.environ.get('MORPH_PLUGIN_PATH', '') self.pluginmgr.locations += s.split(':') + + self.hookmgr = cliapp.HookManager() + self.hookmgr.new('new-build-command', cliapp.FilterHook()) def _itertriplets(self, args): '''Generate repo, ref, filename triples from args.''' @@ -509,6 +512,7 @@ class Morph(cliapp.Application): ''' build_command = BuildCommand(self) + build_command = self.hookmgr.call('new-build-command', build_command) build_command.build(args) def cmd_show_dependencies(self, args): |