Example #1
0
def wrap_command(cmd, cmdclass, hooks):
    def run(self, cmdclass=cmdclass):
        self.run_command_hooks('pre_hook')
        cmdclass.run(self)
        self.run_command_hooks('post_hook')

    return type(cmd, (cmdclass, object),
                {'run': run, 'run_command_hooks': run_command_hooks,
                 'pre_hook': hooks.get('pre_hook'),
                 'post_hook': hooks.get('post_hook')})
Example #2
0
def wrap_command(cmd, cmdclass, hooks):
    def run(self, cmdclass=cmdclass):
        self.run_command_hooks('pre_hook')
        cmdclass.run(self)
        self.run_command_hooks('post_hook')

    return type(cmd, (cmdclass, object),
                {'run': run, 'run_command_hooks': run_command_hooks,
                 'pre_hook': hooks.get('pre_hook'),
                 'post_hook': hooks.get('post_hook')})
Example #3
0
File: util.py Project: jml/pbr
def wrap_command(cmd, cmdclass, hooks):
    def run(self, cmdclass=cmdclass):
        self.run_command_hooks("pre_hook")
        cmdclass.run(self)
        self.run_command_hooks("post_hook")

    return type(
        cmd,
        (cmdclass, object),
        {
            "run": run,
            "run_command_hooks": run_command_hooks,
            "pre_hook": hooks.get("pre_hook"),
            "post_hook": hooks.get("post_hook"),
        },
    )