Created a command line function for adding characters to the input
string
This commit is contained in:
parent
2086a927e1
commit
14cb66767f
|
@ -37,6 +37,8 @@ def open():
|
|||
# Set these values in settings class for use elsewhere
|
||||
settings.set("stdscr", stdscr)
|
||||
settings.set("maxxy", maxxy)
|
||||
settings.set("clinex", 0)
|
||||
settings.set("cliney", 0)
|
||||
|
||||
# Start loop in new thread
|
||||
thread = bt.needle.Needle(cline.loop.loop)
|
||||
|
|
|
@ -2,4 +2,4 @@ __author__="bjschuma"
|
|||
__date__ ="$Dec 19, 2009 9:13:05 PM$"
|
||||
|
||||
|
||||
__all__ = ["loop"]
|
||||
__all__ = ["addch", "loop"]
|
|
@ -0,0 +1,21 @@
|
|||
#! /usr/bin/python
|
||||
|
||||
# To change this template, choose Tools | Templates
|
||||
# and open the template in the editor.
|
||||
|
||||
__author__="bjschuma"
|
||||
__date__ ="$Dec 19, 2009 11:19:43 PM$"
|
||||
|
||||
|
||||
import curses
|
||||
import settings
|
||||
|
||||
|
||||
def addch(input):
|
||||
stdscr = settings.get("stdscr")
|
||||
c = stdscr.getch()
|
||||
|
||||
if(c >= 32 and c<= 126):
|
||||
input += curses.keyname(c)
|
||||
|
||||
return input
|
|
@ -6,11 +6,12 @@
|
|||
__author__="bjschuma"
|
||||
__date__ ="$Dec 19, 2009 9:39:37 PM$"
|
||||
|
||||
import curses
|
||||
|
||||
from bt.message import write
|
||||
import manager
|
||||
import settings
|
||||
|
||||
# Command line related imports
|
||||
from addch import addch
|
||||
|
||||
|
||||
global halt
|
||||
|
@ -20,14 +21,12 @@ def loop():
|
|||
write("Beginning command line loop",True)
|
||||
global halt
|
||||
|
||||
stdscr = settings.get("stdscr")
|
||||
#stdscr = settings.get("stdscr")
|
||||
input = ""
|
||||
|
||||
while halt == False:
|
||||
c = stdscr.getch()
|
||||
input = addch(input)
|
||||
|
||||
if(c >= 32 and c<= 126):
|
||||
input += curses.keyname(c)
|
||||
#input=input[:x-4]+curses.keyname(c)+input[x-4:]
|
||||
#self.changeLine(y)
|
||||
#self.stdscr.move(y,x+1)
|
||||
|
|
Loading…
Reference in New Issue