On Mon, Aug 1, 2011 at 9:57 AM, Andreas Kloeckner
<[email protected]> wrote:
> On Fri, 29 Jul 2011 22:37:16 -0600, Aaron Meurer <[email protected]> wrote:
>> Andreas, how should I do this?  I can either manually wrap text, or I
>> can change it to use some built-in urwid object that does wrapping
>> automatically.  The former would be easier, as it's kind of hard-coded
>> to have plain text rather than urwid.Text, but maybe you can think of
>> a reason why doing urwid.Text (or whatever) would be better.
>
> If you think you can hack up wrapping quickly, go for it. I think I
> opted for 'make my own widget' simply because it allowed me to use
> multiple attributes easily, without having to muck around with multiple
> objects and a container around them.

It shouldn't be too hard to break the string into colsize chunks.  I
just don't know if there are any caveats of doing it manually vs.
using urwid code.  I can't imagine there would be, but I'm not much of
a tty programmer.

>
>> By the way, does this UI design sound sound?  There is a new option in
>> the preferences, "wrap variables", which is False by default.  If the
>> user sets it to True, all variables will be line-wrapped.
>
> I'm not sure it makes sense to have an option here. It's likely
> something that everybody would want.

Well, I'll enable it by default then :)

>
>> Furthermore, the user can change this on a per-variable basis by
>> selecting the variable and either pressing "w" or pressing "Enter" and
>> changing the check-box in the resulting dialog box.
>
> See above. Or can you think of a good reason to not wrap? I suppose the
> right option would be to 'truncate output', rather than turn 'wrap' on
> or off.
>
> Andreas
>

Yes, I definitely think I would want to turn wrapping off, esp. on a
per-variable basis.  Sometimes, you care about the whole variable, and
sometimes you don't.  In SymPy, I very often deal with variables whose
string values are 10000 characters long or even longer (this was also
the motivation for my custom stringifier example, because sometimes
the speed of the printer is less than ideal).

Truncating is an idea, though it sounds like more work than I would
like to do.  This would save memory if variables have large string
values (though not speed, as there's no way to only compute a partial
string value).  It's not so easy, though, as the variable window can
change size.

Aaron Meurer

_______________________________________________
Pudb mailing list
[email protected]
http://lists.tiker.net/listinfo/pudb

Reply via email to