Exemplo n.º 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')})
Exemplo n.º 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')})
Exemplo n.º 3
0
Arquivo: util.py Projeto: 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"),
        },
    )