【问题标题】:How to get fabric commands to update output in place?如何获取结构命令以更新输出?
【发布时间】:2019-01-30 11:00:29
【问题描述】:

Pipeenv 更新命令行输出。 Fabric 1.14.0 将每次更新都视为新行。这会导致大量多余的输出。

我已阅读运行操作的文档。尝试将 capture_buffer_size 设置为 100。没有任何区别。

def install_packages():
    "Install packages on the remote host."""
    with cd('/data/repo/'):
        run("pipenv install", capture_buffer_size=100)

实际结果:

[服务器] 运行:pipenv 安装 [server] out:为这个项目创建一个 virtualenv…
[服务器] 输出:Pipfile: /data/repo/Pipfile
[server] out: 使用 /usr/bin/python3.5 (3.5.2) 创建 virtualenv…
[服务器] 出:
[server] out: ⠋ 创建虚拟环境... [server] out: ⠙ 创建虚拟环境...
[server] out: ⠹ 创建虚拟环境...
[server] out: ⠸ 创建虚拟环境...

……

[server] out: ✔ 成功创建虚拟环境!

预期结果:

[服务器] 运行:pipenv 安装
[server] out:为这个项目创建一个 virtualenv…
[服务器] 输出:Pipfile: /data/repo/Pipfile
[server] out: 使用 /usr/bin/python3.5 (3.5.2) 创建 virtualenv…
[服务器] 出:
[server] out: ⠋ 创建虚拟环境...
[server] out: ✔ 成功创建虚拟环境!

【问题讨论】:

    标签: python fabric pipenv


    【解决方案1】:

    将您的 run("pipenv install") 指令包装在 with hide('output') 上下文管理器中。删除capture_buffer_size kwarg。

    有关调整输出的更多信息,请访问here

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-10-21
      • 2015-12-26
      • 1970-01-01
      • 2011-06-27
      • 1970-01-01
      • 2021-01-14
      • 2011-04-30
      • 1970-01-01
      相关资源
      最近更新 更多