Backspace and enter are now dynamic command line functions. Removed
some things from the default window.
This commit is contained in:
parent
90f363d185
commit
17335545d4
|
@ -24,8 +24,6 @@ from bt.needle import Needle
|
|||
def open():
|
||||
write("Starting CLI", True)
|
||||
|
||||
#thread = Needle(cline.loop.loop)
|
||||
#thread.start()
|
||||
# Tell settings to run this loop
|
||||
settings.set("loop",cline.loop.loop)
|
||||
settings.set("loopquit",cline.loop.quit)
|
||||
|
@ -40,12 +38,9 @@ def open():
|
|||
|
||||
# Called every time the plugin is stopped
|
||||
def close():
|
||||
#settings.pop("loop")
|
||||
#settings.pop("loopquit")()
|
||||
cline.loop.quit()
|
||||
write("CLI has been stopped", True)
|
||||
settings.delete("keyinput")
|
||||
#cline.loop.quit()
|
||||
|
||||
|
||||
def help():
|
||||
|
|
|
@ -17,9 +17,6 @@ def addch(input):
|
|||
stdscr = settings.get("stdscr")
|
||||
c = stdscr.getch()
|
||||
|
||||
#if c == 10:
|
||||
# input = enter(input)
|
||||
|
||||
if(c >= 32 and c<= 126):
|
||||
input += curses.keyname(c)
|
||||
|
||||
|
@ -27,15 +24,12 @@ def addch(input):
|
|||
if (c in keys.keys()) == True:
|
||||
input = keys[c](input)
|
||||
|
||||
|
||||
return input
|
||||
|
||||
|
||||
|
||||
# Remove the last character in input
|
||||
def backspace(input):
|
||||
#stdscr = settings.get("stdscr")
|
||||
#stdscr.deleteln()
|
||||
l = len(input)
|
||||
if(l>4):
|
||||
return input[:l-1]
|
||||
|
|
|
@ -54,7 +54,6 @@ def quit():
|
|||
curses.nocbreak()
|
||||
curses.echo()
|
||||
settings.get("stdscr").keypad(0)
|
||||
#stdscr.keypad(0)
|
||||
curses.endwin()
|
||||
|
||||
# Delete keys that settings no longer needs
|
||||
|
@ -81,15 +80,12 @@ def loop():
|
|||
|
||||
stdscr = settings.get("stdscr")
|
||||
input = settings.get("prompt")
|
||||
#(y, x) = settings.get("stdscr").getyx()
|
||||
disp(input)
|
||||
|
||||
while halt == False:
|
||||
list = settings.get("everyloop",True)
|
||||
#print list
|
||||
if not list == None:
|
||||
for func in list:
|
||||
#write("here!")
|
||||
func()
|
||||
try:
|
||||
input = addch(input)
|
||||
|
|
|
@ -27,10 +27,6 @@ def test(button, name):
|
|||
write("Test!")
|
||||
|
||||
|
||||
#def hide(item,event):
|
||||
# item.hide()
|
||||
|
||||
|
||||
def pluginWindow(item):
|
||||
plugins = window.PluginWindow()
|
||||
|
||||
|
@ -50,11 +46,11 @@ def loop():
|
|||
tools = menu.Item("Tools",None,[plugins])
|
||||
bar.append(tools)
|
||||
|
||||
but = button.Button("button",test,None,"I'm a button!")
|
||||
vbox.pack(but)
|
||||
#but = button.Button("button",test,None,"I'm a button!")
|
||||
#vbox.pack(but)
|
||||
|
||||
lab = label.Label("Hello, World!")
|
||||
vbox.pack(lab)
|
||||
#lab = label.Label("Hello, World!")
|
||||
#vbox.pack(lab)
|
||||
|
||||
settings.set("guirunning",True)
|
||||
gtk.main()
|
||||
|
|
Loading…
Reference in New Issue