2009-12-20 00:45:26 -05:00
|
|
|
#! /usr/bin/python
|
|
|
|
|
|
|
|
# To change this template, choose Tools | Templates
|
|
|
|
# and open the template in the editor.
|
|
|
|
|
|
|
|
__author__="bjschuma"
|
|
|
|
__date__ ="$Dec 19, 2009 11:57:19 PM$"
|
|
|
|
|
2009-12-22 21:59:35 -05:00
|
|
|
|
|
|
|
import curses
|
2009-12-20 00:45:26 -05:00
|
|
|
import settings
|
2009-12-22 21:59:35 -05:00
|
|
|
import bt.message
|
2009-12-20 00:45:26 -05:00
|
|
|
|
|
|
|
|
2009-12-20 18:23:02 -05:00
|
|
|
# Add string to line y
|
|
|
|
def insert(string):
|
|
|
|
stdscr = settings.get("stdscr")
|
2009-12-22 21:59:35 -05:00
|
|
|
max = settings.get("maxyx")[0]
|
2009-12-21 19:28:16 -05:00
|
|
|
y = settings.get("cliney")
|
2009-12-22 21:59:35 -05:00
|
|
|
|
2009-12-20 00:45:26 -05:00
|
|
|
stdscr.addstr(y, 0, string)
|
2009-12-20 18:23:02 -05:00
|
|
|
|
2009-12-22 21:59:35 -05:00
|
|
|
if y < (max-1):
|
|
|
|
settings.replace("cliney", y+1)
|
|
|
|
else:
|
|
|
|
stdscr.move(0,0)
|
|
|
|
stdscr.deleteln()
|
|
|
|
|
2009-12-20 18:23:02 -05:00
|
|
|
|
|
|
|
# Replace the string on the current line
|
|
|
|
def disp(string):
|
|
|
|
stdscr = settings.get("stdscr")
|
2009-12-22 21:59:35 -05:00
|
|
|
try:
|
|
|
|
stdscr.addstr(settings.get("cliney"), 0, string)
|
|
|
|
except:
|
|
|
|
bt.message.error("Error displaying string: "+string)
|