Bug#300288: dstat: terminal color detection broken

2005-04-01 Thread Andrew Pollock
On Thu, Mar 31, 2005 at 12:25:12PM +0200, Dag Wieers wrote:
 
 Now that 0.5.9 has been released, can all of you check if the reported 
 problems with various terminal emulators and TERM settings are completely 
 solved ?
 
 I still haven't found the ultimate way to do ANSI/VT100 manipulation using 
 ncurses in python, but the code looks a bit better now, especially with 
 Charles bright remark :)
 
 For what I've tested it, it seems ok. Andrew, can you close both 
 bugreports after this ?

Both? I'm making 0.5.9 close this particular bug report, but what other one
are you referring to. This is the only outstanding bug that I have at the
moment.

regards

Andrew


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#300288: dstat: terminal color detection broken

2005-04-01 Thread Dag Wieers
On Sat, 2 Apr 2005, Andrew Pollock wrote:

 On Thu, Mar 31, 2005 at 12:25:12PM +0200, Dag Wieers wrote:
  
  Now that 0.5.9 has been released, can all of you check if the reported 
  problems with various terminal emulators and TERM settings are completely 
  solved ?
  
  I still haven't found the ultimate way to do ANSI/VT100 manipulation using 
  ncurses in python, but the code looks a bit better now, especially with 
  Charles bright remark :)
  
  For what I've tested it, it seems ok. Andrew, can you close both 
  bugreports after this ?
 
 Both? I'm making 0.5.9 close this particular bug report, but what other one
 are you referring to. This is the only outstanding bug that I have at the
 moment.

Sorry, the other one was already resolved. No worries :)

Thanks a lot for your help Andrew ! Much appreciated.

Kind regards,
--   dag wieers,  [EMAIL PROTECTED],  http://dag.wieers.com/   --
[all I want is a warm bed and a kind word and unlimited power]


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#300288: dstat: terminal color detection broken

2005-03-31 Thread Dag Wieers
On Sun, 20 Mar 2005, Dag Wieers wrote:

 On Sat, 19 Mar 2005, Charles Lepple wrote:
  Dag Wieers said:
 
   When I want to save it, I get:
  
 Formatting error: Internal base64 decoder error: Error writing 
   attachment
   to /home/dag/dstat-color.patch
  
  Hmm, maybe it's time to file a bug against SquirrelMail, too :-) (Looks
  like it forgot a newline between the base64 part and the MIME boundary--
  strange...)
  
  I'll try attaching it again, but if you download the patch from the link
  at http://bugs.debian.org/300288 and chop off the last line (garbage from
  decoding the boundary), it should be OK.
 
 Perfect, your patch has been incorporated! Until I find someone who 
 knows how to do this cleaner using ncurses... v0.5.9 will probably be 
 released somewhere next week.

Now that 0.5.9 has been released, can all of you check if the reported 
problems with various terminal emulators and TERM settings are completely 
solved ?

I still haven't found the ultimate way to do ANSI/VT100 manipulation using 
ncurses in python, but the code looks a bit better now, especially with 
Charles bright remark :)

For what I've tested it, it seems ok. Andrew, can you close both 
bugreports after this ?

Thanks for your support !
--   dag wieers,  [EMAIL PROTECTED],  http://dag.wieers.com/   --
[all I want is a warm bed and a kind word and unlimited power]


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#300288: dstat: terminal color detection broken

2005-03-19 Thread Dag Wieers
On Sat, 19 Mar 2005, Charles Lepple wrote:

 Dag Wieers said:
  When I want to save it, I get:
 
  Formatting error: Internal base64 decoder error: Error writing 
  attachment
  to /home/dag/dstat-color.patch
 
 Hmm, maybe it's time to file a bug against SquirrelMail, too :-) (Looks
 like it forgot a newline between the base64 part and the MIME boundary--
 strange...)
 
 I'll try attaching it again, but if you download the patch from the link
 at http://bugs.debian.org/300288 and chop off the last line (garbage from
 decoding the boundary), it should be OK.

Perfect, your patch has been incorporated! Until I find someone who 
knows how to do this cleaner using ncurses... v0.5.9 will probably be 
released somewhere next week.

Thanks for your help !
--   dag wieers,  [EMAIL PROTECTED],  http://dag.wieers.com/   --
[all I want is a warm bed and a kind word and unlimited power]


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#300288: dstat: terminal color detection broken

2005-03-18 Thread Charles Lepple
Package: dstat
Version: 0.5.7-2
Severity: normal

on line 1254 of dstat (0.5.7-2):

### Check terminal capabilities
#if not sys.stdout.isatty() or not curses.wrapper(lambda \ 
# s:curses.has_colors()):
 if not sys.stdout.isatty() or os.environ.get('TERM',None) not in \
('ansi', 'linux', 'rxvt', 'screen', 'screen-w', 'xterm'):
op.color = False
op.nolimit = True
op.update = False

When using xterm-color, dstat reverts back to uncolored, continuous (no
headers) format.

Also, I'm not exactly sure about the op.nolimit and op.update options,
but it seems like those should be conditional on the not
sys.stdout.isatty() test, and if stdout is a terminal, then op.color
should be set. That way, even if I am on a non-color-capable terminal,
the headers will get redisplayed once per screenful of stats.

I realize that adding all color-capable terminals to the list would be a
big maintenance headache, but it would be nice if any terminal ending in
-color turned on op.color. Or, there could be a --color option to
complement --nocolor.

-- System Information:
Debian Release: 3.1
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: i386 (i686)
Kernel: Linux 2.6.9.skas-2
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=ANSI_X3.4-1968)

Versions of packages dstat depends on:
ii  python2.3.5-1An interactive high-level object-o

-- no debconf information


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#300288: dstat: terminal color detection broken

2005-03-18 Thread Dag Wieers
On Fri, 18 Mar 2005, Charles Lepple wrote:

 on line 1254 of dstat (0.5.7-2):
 
 ### Check terminal capabilities
 #if not sys.stdout.isatty() or not curses.wrapper(lambda \ 
 # s:curses.has_colors()):
  if not sys.stdout.isatty() or os.environ.get('TERM',None) not in \
 ('ansi', 'linux', 'rxvt', 'screen', 'screen-w', 'xterm'):
 op.color = False
 op.nolimit = True
 op.update = False
 
 When using xterm-color, dstat reverts back to uncolored, continuous (no
 headers) format.

Ack. :(


 Also, I'm not exactly sure about the op.nolimit and op.update options,
 but it seems like those should be conditional on the not
 sys.stdout.isatty() test, and if stdout is a terminal, then op.color
 should be set. That way, even if I am on a non-color-capable terminal,
 the headers will get redisplayed once per screenful of stats.

This was actually for people who were piping the output to a file. In that 
case you don't want colors or any of the ansi/vt100 crap :) But there's a 
lot of potential improvements in this area.


 I realize that adding all color-capable terminals to the list would be a
 big maintenance headache, but it would be nice if any terminal ending in
 -color turned on op.color. Or, there could be a --color option to
 complement --nocolor.

I'd love to use ncurses for what it was designed, sadly if I try to use 
ncurses it clears the complete screen or does something ugly inside a 
screen.

Any help in this regard is welcome. I know my current implementation is 
probably only useful to 90% of the users. I already had problem reports 
on older (debian stable) rxvt and recently eterm, using ncurses would be a 
good help. I worked around the rxvt and still have to try out eterm.

Anyone with python and ncurses skills around ? :)

BTW thanks for your feedback !
--   dag wieers,  [EMAIL PROTECTED],  http://dag.wieers.com/   --
[all I want is a warm bed and a kind word and unlimited power]


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#300288: dstat: terminal color detection broken

2005-03-18 Thread Charles Lepple
Dag Wieers said:
 On Fri, 18 Mar 2005, Charles Lepple wrote:
 Also, I'm not exactly sure about the op.nolimit and op.update options,
 but it seems like those should be conditional on the not
 sys.stdout.isatty() test, and if stdout is a terminal, then op.color
 should be set. That way, even if I am on a non-color-capable terminal,
 the headers will get redisplayed once per screenful of stats.

 This was actually for people who were piping the output to a file. In that
 case you don't want colors or any of the ansi/vt100 crap :) But there's a
 lot of potential improvements in this area.

Understood. I think it's a neat idea, it just looks like it got broken
when the ncurses stuff was removed.

How's the attached patch for starters?

 I realize that adding all color-capable terminals to the list would be a
 big maintenance headache, but it would be nice if any terminal ending in
 -color turned on op.color. Or, there could be a --color option to
 complement --nocolor.

 I'd love to use ncurses for what it was designed, sadly if I try to use
 ncurses it clears the complete screen or does something ugly inside a
 screen.

I tend to avoid ncurses whenever possible, sorry :-)

I'm feeling lazy, so I didn't even attempt to do matching for terminal
names ending in '-color', but 'xterm-color' is common enough.

-- 
Charles Lepple


dstat-color.patch
Description: Binary data


Bug#300288: dstat: terminal color detection broken

2005-03-18 Thread Dag Wieers
On Sat, 19 Mar 2005, Charles Lepple wrote:

 Dag Wieers said:
  On Fri, 18 Mar 2005, Charles Lepple wrote:
  Also, I'm not exactly sure about the op.nolimit and op.update options,
  but it seems like those should be conditional on the not
  sys.stdout.isatty() test, and if stdout is a terminal, then op.color
  should be set. That way, even if I am on a non-color-capable terminal,
  the headers will get redisplayed once per screenful of stats.
 
  This was actually for people who were piping the output to a file. In that
  case you don't want colors or any of the ansi/vt100 crap :) But there's a
  lot of potential improvements in this area.
 
 Understood. I think it's a neat idea, it just looks like it got broken
 when the ncurses stuff was removed.
 
 How's the attached patch for starters?

When I want to save it, I get:

Formatting error: Internal base64 decoder error: Error writing 
attachment to /home/dag/dstat-color.patch

Duh!

--   dag wieers,  [EMAIL PROTECTED],  http://dag.wieers.com/   --
[all I want is a warm bed and a kind word and unlimited power]


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]