|
|
self.lines = data.splitlines() | self.lines = data.splitlines() |
else: | else: |
self.lines = data | self.lines = data |
for i, line in zip(xrange(len(self.lines)), self.lines): |
for i, line in zip(range(len(self.lines)), self.lines): |
self.pad.addstr(i, 0, line) | self.pad.addstr(i, 0, line) |
self.scroll(0) | self.scroll(0) |
else: | else: |
|
|
new = 0 | new = 0 |
elif new >= len(self.lines): | elif new >= len(self.lines): |
new = len(self.lines)-1 | new = len(self.lines)-1 |
|
|
self.pad.addstr(self.cur, 0, self.lines[self.cur]) |
if len(self.lines)>1: |
self.pad.addstr(new, 0, self.lines[new], self.hl) |
self.pad.addstr(self.cur, 0, self.lines[self.cur]) |
|
self.pad.addstr(new, 0, self.lines[new], self.hl) |
self.cur = new | self.cur = new |
self.refresh() | self.refresh() |
| |
|
Lines 620-633
warranty; not even for MERCHANTABILITY o
|
Link Here
|
|---|
|
opts, args= p.parse_args() | opts, args= p.parse_args() |
| |
# Just instanciate the right GUI to start up the application | # Just instanciate the right GUI to start up the application |
# In orger, we try to instanciate the Tk, curses and raw |
# In order, we try to instanciate the Tk, curses and raw |
# interface, falling to the next in case of unavailability or | # interface, falling to the next in case of unavailability or |
# initialization errors | # initialization errors |
# |
# |
select = opts.raw + opts.curses + opts.Tk | select = opts.raw + opts.curses + opts.Tk |
for ui in ('Tk', 'curses', 'raw'): | for ui in ('Tk', 'curses', 'raw'): |
if (globals().has_key('%sGUI' % ui) and | if (globals().has_key('%sGUI' % ui) and |
getattr(opts, ui) or select==0 or ui=='raw'): |
(getattr(opts, ui) or select==0 or ui=='raw')): |
if globals()['%sGUI' % ui](): break | if globals()['%sGUI' % ui](): break |