使用pexpect处理提示的织物扩展
fexpect的Python项目详细描述
fexpect是fabric的扩展,用于使用pexpect脚本处理提示。
这些博客中的临时文档:
- http://ilogue.com/jasper/blog/fexpect–dealing-with-prompts-in-fabric-with-pexpect/
- http://ilogue.com/jasper/blog/improved-fexpect-now-on-pypi/
请报告错误,请求github存储库中的功能:http://github.com/ilogue/fexpect
似乎它与easy_install不兼容,请使用pip安装。
用法
from ilogue.fexpect import expect, expecting, run prompts = [] prompts += expect('What is your name?','Jasper') prompts += expect('Where do you live?','Frankfurt') with expecting(prompts): run('command')
您可以使用包含的fabfile.py运行fexpect测试:
fab test -p 'yourlocalpassword'
但是请注意,测试可能有不同的要求(更新的结构版本)。您可以使用传统的:
python setup.py test
贡献者
- Jasper van den Bosch/伊洛格
- 迈克尔·伊万诺夫
- 小仓三郎
- 埃里克·戴克马