bpython / curtsies

Curses-like terminal wrapper with a display based on compositing 2d arrays of text.
MIT License
228 stars 52 forks source link

Share code with urwid #37

Open thomasballinger opened 10 years ago

thomasballinger commented 10 years ago

I bet there's a bunch of code we should be sharing in this area, like color names, settings and "default" terminal attributes, see http://urwid.org/reference/attrspec.html and http://urwid.org/manual/displayattributes.html#display-attributes

-@wardi

Most sensible way to do this is probably making urwid a dependency of curtsies - it's not a painful dependency at all. Presumably this doesn't mean we should remove blessings, just add urwid.

Things we could do:

thomasballinger commented 10 years ago

We shouldn't do this if it's limiting - just if it means less code to maintain. Also check out @gwk's stuff: https://github.com/gwk/gloss/blob/master/python/gloss/io/sgr.py - if it's more elegant or powerful we don't want to limit ourselves. For this issue, we should take stock of everything adding an urwid dependency would simplify.

wardi commented 10 years ago

I'd also be happy to separate out the low-level terminal handling parts of urwid into another package that urwid and any other package could use. urwid is an easy dependency because it doesn't require anything else, but it is kind of large :-)

It's nicer if we can settle on one way of doing the sort of thing that urwid's AttrSpec so we can share code without adding layers for converting things back and forth.

thomasballinger commented 8 years ago

This looks less likely: I'm planning to make FmtStr be closer to Blessed formatted strings. However this should still be checked out, I'm not sure how colored strings are going to work.