krill
krill copied to clipboard
Curses/Blessings unsupported on windows
Krill crashes on windows.
The root cause of the crash is that curses is not on windows machines.
The library you are using for terminal manipulation (blessings) has an open issue on github for this here.
It looks like you are only using this to color/format text in the terminal. It may be worth looking into colorama which is cross platform.
If I have time I might try and implement this myself.
Traceback:
Traceback (most recent call last):
File "C:\Python34\lib\runpy.py", line 170, in _run_module_as_main
"__main__", mod_spec)
File "C:\Python34\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\Python34\Scripts\krill.exe\__main__.py", line 5, in <module>
File "C:\Python34\lib\site-packages\krill\krill.py", line 31, in <module>
from blessings import Terminal
File "C:\Python34\lib\site-packages\blessings\__init__.py", line 5, in <module>
import curses
File "C:\Python34\lib\curses\__init__.py", line 13, in <module>
from _curses import *
ImportError: No module named '_curses'
Other than this minor issue I really like you code :)
Thank you for the input. I do not have access to a Windows machine so supporting Windows is not really on my agenda, but I hear there are proper terminal emulators for Windows too (e.g. one based on PuTTY) that have no problem with ANSI escape codes. Alternatively, Cygwin has a curses implementation that should work as well.
I don't quite understand why blessings requires curses in the first place though. What little terminal features it offers could easily be provided with raw escape sequences.
Alternately, could you add a flag which would disable curses color?
AFAIK (having been looking at curses/blessings/urwid/etc lately), I suspect it's that curses wraps a lot of terminal functionality behind the scenes. As in, you could successfully use krill on a terminal that actually doesn't support colors, as curses wraps something like termcap and then will display the ansi sequences or not, depending. I could be wrong, though ;)
As another alternative to colorama, I think clint supports Windows... but I don't currently have a Windows box so I could be wrong about that one, too :P
It looks like the Click library handles ANSI colors automagically. With an added bonus of making CLI parsing rather nice ;)