use colorama on windows
This commit is contained in:
parent
111c2b60b5
commit
5a04018b1f
|
@ -6,3 +6,4 @@ dist
|
|||
0inst
|
||||
*.stamp
|
||||
*-local.xml
|
||||
gup
|
||||
|
|
|
@ -34,6 +34,10 @@ import linecache
|
|||
import re
|
||||
import time
|
||||
|
||||
colorama = None
|
||||
if os.name == 'nt':
|
||||
import colorama
|
||||
|
||||
import nose
|
||||
|
||||
import termstyle
|
||||
|
@ -194,6 +198,8 @@ class RedNose(nose.plugins.Plugin):
|
|||
self._print_test(skip, termstyle.blue)
|
||||
|
||||
def setOutputStream(self, stream):
|
||||
if colorama:
|
||||
stream = colorama.initialise.wrap_stream(stream, convert=True, strip=False, autoreset=False, wrap=True)
|
||||
self.stream = stream
|
||||
|
||||
def report(self, stream):
|
||||
|
|
|
@ -109,6 +109,7 @@ nosetests --no-color
|
|||
<requires interface="http://gfxmonk.net/dist/0install/python-termstyle.xml">
|
||||
<version not-before="0.1.7"/>
|
||||
</requires>
|
||||
<requires interface="http://gfxmonk.github.io/0downstream/feeds/pypi/colorama.xml" os="Windows"/>
|
||||
<implementation version="{version}" released="{date}">
|
||||
<manifest-digest/>
|
||||
<archive href="{archive}"/>
|
||||
|
|
2
setup.py
2
setup.py
|
@ -9,7 +9,7 @@ setup(
|
|||
packages = find_packages(exclude=['test', 'test.*']),
|
||||
description='coloured output for nosetests',
|
||||
entry_points={'nose.plugins.0.10': ['NOSETESTS_PLUGINS = rednose:RedNose']},
|
||||
install_requires=['setuptools', 'python-termstyle >=0.1.7'],
|
||||
install_requires=['setuptools', 'termstyle >=0.1.7', 'colorama'],
|
||||
long_description="\n**Note**: This package has been built automatically by\n`zero2pypi <http://gfxmonk.net/dist/0install/zero2pypi.xml>`_.\nIf possible, you should use the zero-install feed instead:\nhttp://gfxmonk.net/dist/0install/rednose.xml\n\n----------------\n\n=========\nrednose\n=========\n\nrednose is a `nosetests`_\nplugin for adding colour (and readability) to nosetest console results.\n\nInstallation:\n-------------\n::\n\n\teasy_install rednose\n\t\nor from the source::\n\n\t./setup.py develop\n\nUsage:\n------\n::\n\n\tnosetests --rednose\n\nor::\n\n\texport NOSE_REDNOSE=1\n\tnosetests\n\nRednose by default uses auto-colouring, which will only use\ncolour if you're running it on a terminal (i.e not piping it\nto a file). To control colouring, use one of::\n\n\tnosetests --rednose --force-color\n\tnosetests --no-color\n\n(you can also control this by setting the environment variable NOSE_REDNOSE_COLOR to 'force' or 'no')\n\n.. _nosetests: http://somethingaboutorange.com/mrl/projects/nose/\n",
|
||||
name='rednose',
|
||||
py_modules=['rednose'],
|
||||
|
|
Loading…
Reference in New Issue