Giter VIP home page Giter VIP logo

colorclass's People

Contributors

edwardbetts avatar msabramo avatar robpol86 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

colorclass's Issues

Not working in some ssh clients

It seems some ssh clients under windows don't respect the color settings.

I am not familiar about how to show color in terminal. Can you give me a hint?

CJK Character support

tests/test_width_and_alignment.py:16: in <module>
    (Color('{autoblue}世界你好{/autoblue}'), 8),
.tox/py26/lib/python2.6/site-packages/colorclass.py:391: in __new__
    obj = parent_class.__new__(cls, *args, **kwargs)
E   UnicodeDecodeError: 'ascii' codec can't decode byte 0xe4 in position 5: ordinal not in range(128)

Automatically detect ANSI color support in new Windows conhost.

http://www.nivot.org/blog/post/2016/02/04/Windows-10-TH2-%28v1511%29-Console-Host-Enhancements
https://msdn.microsoft.com/en-us/library/ms683167.aspx
https://msdn.microsoft.com/en-us/library/mt638032.aspx

Looks like (compared to archive.org) ENABLE_VIRTUAL_TERMINAL_PROCESSING (0x0004) was recently added to GetConsoleMode (and set). Perhaps I can use this to determine if stdout/stderr streams should not be replaced on Windows, instead of having users of colorclass figure it out themselves?

`disable_all_colors()` not working?

It's probably me being silly and it using it correctly, but from what i could gather from the docs, calling it anywhere should just disable all colors;

>>> from colorclass import disable_all_colors
>>> print string
←[31mbla←[39m
>>> disable_all_colors()
>>> print string
←[31mbla←[39m
>>>

What am I doing wrong? tried it both on Windows 7, 10 and Ubuntu...

Slicing is not consistent between a regular string and a Colorclass string

Python 2.7.13 (default, Jul 24 2017, 20:13:18)
[GCC 4.9.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from colorclass import Color

>>> s = 'This is a test string ...'
>>> c = Color('{autogreen}This is a test string ...{/autogreen}')

>>> print s
This is a test string ...
>>> print c
This is a test string ...
>>> print s[:14]
This is a test
>>> print c[:14]
This is a

# work around
>>> print c.value_colors.replace(c.value_no_colors, c.value_no_colors[:14])
This is a test

Windows.enable() breaks colors

I'm on Windows 10 (64bit), Python 3.5.1.

Calling Windows.enable() as per documentation actually doesn't show the colors (although it does parse the string correctly). Commenting it out yields the correct behaviour.

Fix reset_atexit.

Looks like using atexit isn't actually resetting the console's background color.

Fixed it in "windows" branch, but need to fully test in my VMs first.

.format() color injection

>>> print(colorclass.Color('{red}XXX: {/red}{}').format('{green}moo{/green}'))
XXX: moo

Expected: XXX: {green}moo{/green} (with XXX: in red)
Actual: XXX: moo (with XXX: in red and moo in green)

This is especially annoying since it means one cannot use the Color class without the tag parsing.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.