如何覆盖pyinvoke先前定义的规则,但是“ super”调用较旧的实现?

问题描述

我有一个standard_tasks.py模块,它提供了构建任务

@task
def build(ctx):
    do_this()

从我的task.py当前正在执行的操作

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

但是,这感觉很笨拙。我想知道是否有更好的方法?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...