您的位置:首页 > 运维架构 > Tomcat

eclipse加入tomcat插件

2011-08-04 09:00 302 查看
    Lettuce 是python开发的BDD(Behavior-driven-development)的框架。熟悉Ruby的人都知道,ruby世界的经典BDD框架应属Cucumber。而Lettuce相当于Cucumber的python版。查看Lettuce详细信息请参见http://lettuce.it/或http://github.com/gabrielfalcao/lettuce。

    本着对新鲜事物的好奇(其实也不是新鲜事物,自己不懂就算新鲜咯


),便下了一个试玩。发现使用Lettuce在windows下做测试时,无法显示颜色。只是显示了一对代码。

写道

[1;37mFeature: Compute factorial [1;30m# \featur

[1;37m In order to play with Lettuce [1;30m# \featur

[1;37m As beginners [1;30m# \featur

[1;37m We'll implement factorial [1;30m# \featur

[1;37m Scenario Outline: Factorials of [0-4] [1;30m# \featur

[0;36m Given I have the number <number> [1;30m# \featur

[0;36m When I compute its factorial [1;30m# \featur

[0;36m Then I see the number <result> [1;30m# \featur

[1;37m Examples:[0m
   无奈上网查,无果。后来找了一个可以在控制台下显示颜色的python库colorama。安装之后,修改lettuce\plugins\colored_shell_output.py文件,在文件头上加一行from colorama import init; init() 搞定。

   看了一下init()的源码,发现只是给标准输出流,错误输出流加了一个包装器,对输出做了一些手脚。另外,在linux下不需要任何修改就可以显示颜色。

   解决方法虽有些猥琐,但尚可使用。希望有知道正确解决方法的大蟒们不吝赐教。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: