From 133f1be38abcca8ebf9b2bfcb76de5fa38238b48 Mon Sep 17 00:00:00 2001 From: Daniel Wagner Date: Tue, 26 Sep 2017 09:33:31 +0200 Subject: [PATCH] libcmds: Remove unused pre and post hooks 9e136e532d4e ("config: Remove dynamic configuration variant") removed the posibility to add pre and post hooks. Remove the remaining bits from libcmds. Signed-off-by: Daniel Wagner --- kas/config.py | 24 ------------------------ kas/libcmds.py | 17 ++--------------- 2 files changed, 2 insertions(+), 39 deletions(-) diff --git a/kas/config.py b/kas/config.py index 3922f03..cc4c4fd 100644 --- a/kas/config.py +++ b/kas/config.py @@ -205,30 +205,6 @@ class Config: repo_dict[repo] = rep return repo_dict - def pre_hook(self, fname): - """ - Returns a function that is executed before every command or None. - """ - # pylint: disable=unused-argument - - pass - - def post_hook(self, fname): - """ - Returs a function that is executed after every command or None. - """ - # pylint: disable=unused-argument - - pass - - def get_hook(self, fname): - """ - Returns a function that is executed instead of the command or None. - """ - # pylint: disable=unused-argument - - pass - def get_bitbake_target(self): """ Return the bitbake target diff --git a/kas/libcmds.py b/kas/libcmds.py index 052425e..949edfb 100644 --- a/kas/libcmds.py +++ b/kas/libcmds.py @@ -56,21 +56,8 @@ class Macro: command_name = str(command) if command_name in skip: continue - pre_hook = config.pre_hook(command_name) - if pre_hook: - logging.debug('execute %s', pre_hook) - pre_hook(config) - command_hook = config.get_hook(command_name) - if command_hook: - logging.debug('execute %s', command_hook) - command_hook(config) - else: - logging.debug('execute %s', command_name) - command.execute(config) - post_hook = config.post_hook(command_name) - if post_hook: - logging.debug('execute %s', post_hook) - post_hook(config) + logging.debug('execute %s', command_name) + command.execute(config) class Command: