Curses.Blinkenlights debugging

Kurt Granroth kurt.offlineimap at
Mon Apr 5 16:32:31 BST 2010

Kurt Granroth <kurt.offlineimap <at>> writes:
> I run offlineimap on a number of systems and the output of
> Curses.Blinkenlights differs in ways that I have never been able to
> figure out.
> For instance, on an Ubuntu system, Curses.Blinkenlights works
> perfectly and everything looks exactly like you'd expect
> On a couple of OpenSUSE systems, though, Curses.Blinkenlights
> *mostly* works.  That is, it shows all of the "text" bits of the
> output but shows only a blank screen where the LEDs should be.
> On one OpenSUSE system (nearly identical to the other two),
> Curses.Blinkenlights doesn't work at all!  Offlineimap throws up
> an error about an invalid UI and defaults to the TTY.UI.

To follow up to my own post...

The singular OpenSUSE system with the completely non-working
Curses.Blinkenlights was a dumb user error.  I (mistakenly) assumed
that python-curses was a dependency of offlinemap and would be
installed when offlineimap was installed.  It's not.  A quick check
disabused me of that notion.  I manually installed python-curses and
now all of my OpenSUSE systems have a working Curses.Blinkenlights.

Working, that is, with the exception of the blank account status area.
The lower left hand corner is completely black, followed by the
blinking "leds".

I'm not very familiar with curses but this is python, after all, so
why not dig around.  I discovered that the invisible text is written
out in the CursesAccountFrame.drawleadstr(sec) method.  That's just
doing a simple addstr like everything else so maybe it's color related
(black text on a black background)?  That method doesn't work with
color so I trace down a few levels.

Now I'm at Blinkenlights.setupwindow().  I can't find any place where
the color of the lead string is set.  I *do* see where the color is
set for a bunch of other parts of the screen, though.  So just for
fun, I do this:

+++   2010-04-05 08:25:51.000000000 -0700
---      2010-04-05 08:25:12.000000000 -0700
@@ -436,8 +436,6 @@
             s.hotkeys = []
             for account in accounts:
                 accountwindow = curses.newwin(1, s.c.width, pos, 0)
+                color = s.c.getpair(curses.COLOR_WHITE, curses.COLOR_BLACK) |\
+                                    curses.A_BOLD
+                accountwindow.bkgd(' ', color)

       [account].setwindow(accountwindow, acctkeys[index])

Tadah!  That actually works.  I can see the account status text (lead
str) finally!

I don't need those lines on an Ubuntu system, though.  So why are they
needed on my OpenSUSE system?

More information about the OfflineIMAP-project mailing list