else: w += 1
## Done.
- #print ';; %r -> %d' % (s, w)
return w
class StatusLine (object):
## Eyecandy update.
if me.eyecandyp:
- #print
- #print ';; new status %r' % line
## If the old line was longer, we need to clobber its tail, so work out
## what that involves.
## Actually do the output, all in one syscall.
b = charwidth(me._last[i:])
SYS.stdout.write(pre + '\b'*b + line[i:])
- #print ';; => %r' % (pre + '\b'*b + line[i:])
SYS.stdout.flush()
## Update our idea of what's gone on.
## Handy abbreviations for constructed parser elements.
def K(k): return P.Keyword(k).suppress()
def D(d): return P.Literal(d).suppress()
-##R = P.ZeroOrMore
def R(p): return P.ZeroOrMore(p).setParseAction(lambda s, l, t: [t])
O = P.Optional