9 Commits

Author SHA1 Message Date
Delgan
f926bcccc2 Add automatic hook based on an environment variable 2017-10-19 12:01:29 +02:00
Delgan
c9c2ce9d9c Add a way to use better_exceptions functions without side effects
Importing 'better_exceptions' automatically replaces the default sys.excepthook and
add an handler to the root logger.
This is very useful in most cases, but sometimes the user may want to use library
functions without any side effects.

Two packages can be published: the first contains all the functions of the library,
and the second uses these functions to automatically set up the better exception system.
The user can choose the package he wants to import, and there is no code repetition
in the repository

The core functions had to be encapsulated into a class so that user can still modify
global parameters to his convenience.
2017-09-13 09:06:45 +02:00
Delgan
35eaebff0b Fix raw codes appearing with Python 3 on Windows cmd
Colorama does not wrap the 'buffer' attributes of streams, so writing
to it would not convert ANSI codes on Windows.
The workaround is to use '.write()' without encoding the string,
and rather wrap the stream used by Colorama to encode substrings
which are sent once win32 call are made.
2017-09-11 09:59:20 +02:00
Delgan
f9e1dddc27 Fix uncaught error on some exotic environments 2017-09-10 22:25:01 +02:00
TaoBeier
821b9e4555 fix indentation and change nodes iterable 2017-09-10 22:11:09 +02:00
Josh Junon
9a53e5ffa8 add isatty(2) check back in to color support detection 2017-03-28 14:16:31 -07:00
Josh Junon
e45928fb6b add more terminfo paths 2017-03-23 10:55:51 -07:00
P M
f33c858e15 Improve terminfo detection (fixes #15) (#16)
* Iterate over possible terminfo directories.

* Simplify iterating over terminfo subdirs.
2017-03-23 10:53:33 -07:00
Josh
87413759cc use better color detection methods and add color support on windows
Makes color detection a little more intuitive and adds proper Windows support via colorama (only installed on Windows).
2017-03-22 18:41:02 -07:00