Stefano Borini
Stefano Borini

Reputation: 143875

How can I override a pyinvoke previously defined rule, but "super()" call the older implementation?

I have a standard_tasks.py module that provides a task for build

@task
def build(ctx):
    do_this()

from my tasks.py I am currently doing

from standard_tasks import *
_super_build = build.body

@task
def _build(ctx):
    # Here I want to call the older implementation that triggered do_this()
    _super_build(ctx)
    do_that()

build.body = _build

However, this feels clunky. I was wondering if there's a better way?

Upvotes: 0

Views: 57

Answers (0)

Related Questions