Comments (5)
You could go as far as something like this:
class NullStream:
def write(self, text):
pass
import sys
sys.stdout = NullStream()
from lettuce.
Actually, the feature I'm thinking to implement on couleur is pretty much it :)
Thanks
from lettuce.
My 2 pesos:
Please consider the fact that the Winblows shell (aka dos prompt) does not understand *nix color codes. I got lettuce installed and fired it up and guess what I saw... the cryptic stuff below!
←[1;31mOops!←[0m
←[1;37mcould not find features at ←[1;33m\features←[0m
I quickly jumped into cygwin (the poor-man's *nix on Winblows) and saw a nicely colored output saying:
Oops!
could not find features at ./features
The "Oops!" was in red. The "could not find..." was bright white and the "./features" was in yellow. The garbled message I got in the dos shell earlier was just a nicely colored output -- visible only in a *nix shell.
Digging through the code I noticed that lettuce uses plugins to handle output -- AWESOME! On a Win machine the only solution is to just spit stuff out without any color codes. From what I saw in the lettuce code, it selects the output handler based on the verbosity level passed in:
-v VERBOSITY, --verbosity=VERBOSITY
So if I run lettuce with a verbosity level of 0, it loads the non_verbose plugin. If I run it with a verbosity level of 3, it loads the shell_output plugin. Both these plugins output straight text without any coloring. Any other verbosity level (and if no level is specified), the output is handled by the colored_shell_output plugin.
I'm sure by now you can see that the only way for a poor Winblows developer like myself to get any real benefit out of lettuce is to pass it a verbosity level "3". If the shell_output plugin is "improved" to always output in color the Python-Winblows universe may very well collapse in on itself! Ok, ok, I guess that's an exaggeration but you get my point.
So Gaberiel, my suggestion is that if you want to implement color support for verbosity level 3 (and I think that is a good thing), please consider implementing such that it can be turned on/off as needed. In fact a very good pattern for the color feature is to make it possible to toggle it independently of the verbosity level.
Thanks and keep up the awesome work.
from lettuce.
I'm gonna make couleur support windows
from lettuce.
shell output using couleur, closed by 8894b9d
from lettuce.
Related Issues (20)
- Improperly configured with lettuce 0.2.23 HOT 2
- Run tests on multiple Django versions HOT 1
- BaseCommand.option_list Dropped in Django 10
- Exponential test time increase with more examples HOT 1
- placing step files
- --root-dir parameter needs space before assignment HOT 1
- AttributeError: type object 'BaseCommand' has no attribute 'option_list' HOT 5
- Django 1.10x breaks when LiveServerTestCase if restarted too quickly HOT 1
- Django 1.9 Application labels aren't unique, duplicates: django HOT 1
- Partial name matching of apps causes problems HOT 1
- Using LETTUCE_USE_TEST_DATABASE with django harvest management command causes error
- Initialisation error in Django project HOT 6
- python 2.7, print statement not working HOT 1
- --failfast: broken tests do not show up properly in xunit output
- Replace key 'uk' for ukrainian language with 'ua'
- No longer maintained? HOT 2
- Website and docs disappeared this week HOT 2
- @nikolas Did you get a chance to complete the migration? So far i have encountered some minor problem with mox.
- All outlines succeeded but scenario status is failed
- Test code generation?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lettuce.