From 17335545d4ed5f7ac9f7fbae3a08f0723d0c09e0 Mon Sep 17 00:00:00 2001 From: bjschuma Date: Sat, 16 Jan 2010 11:52:09 -0500 Subject: [PATCH] Backspace and enter are now dynamic command line functions. Removed some things from the default window. --- src/core/cli.py | 5 ----- src/core/cline/addch.py | 6 ------ src/core/cline/loop.py | 4 ---- src/extra/sgtk.py | 12 ++++-------- 4 files changed, 4 insertions(+), 23 deletions(-) diff --git a/src/core/cli.py b/src/core/cli.py index c6e9cb21..321e2f1a 100644 --- a/src/core/cli.py +++ b/src/core/cli.py @@ -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(): diff --git a/src/core/cline/addch.py b/src/core/cline/addch.py index 90d0424c..435ff731 100644 --- a/src/core/cline/addch.py +++ b/src/core/cline/addch.py @@ -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] diff --git a/src/core/cline/loop.py b/src/core/cline/loop.py index 4b2c4e63..a92467fa 100644 --- a/src/core/cline/loop.py +++ b/src/core/cline/loop.py @@ -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) diff --git a/src/extra/sgtk.py b/src/extra/sgtk.py index ed6c74d8..a6cc16e8 100644 --- a/src/extra/sgtk.py +++ b/src/extra/sgtk.py @@ -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()