diff --git a/src/base/bt/message.py b/src/base/bt/message.py index 0d5960b2..4aba096c 100644 --- a/src/base/bt/message.py +++ b/src/base/bt/message.py @@ -32,12 +32,7 @@ def write(text,verbose=False): if enabled == False: return if (verbose==False) or (settings.get("verbose")==True): - bt.signal.emit("write",str(text)) - #w = settings.get("write") - #if w == None: - # disp(str(text)) - #else: - # w(str(text)) + bt.signal.emit("message-write",str(text)) # Print an error message @@ -50,4 +45,4 @@ def error(text, trace): #settings.set("write", disp) -bt.signal.register("write",disp) \ No newline at end of file +bt.signal.register("message-write",disp) \ No newline at end of file diff --git a/src/base/manager.py b/src/base/manager.py index ecb400ff..791c84af 100644 --- a/src/base/manager.py +++ b/src/base/manager.py @@ -1,5 +1,4 @@ - __author__="bjschuma" __date__ ="$Dec 8, 2009 8:40:36 AM$" @@ -83,7 +82,7 @@ class Manager: # Disable all plugins def shutdown(self): - emit("quit") + emit("scion-end") write("Shutting down manager, disabling all active plugins", True) session = self.findsession() self.savesession(session) diff --git a/src/base/scion.py b/src/base/scion.py index 4744f49c..d38d0443 100644 --- a/src/base/scion.py +++ b/src/base/scion.py @@ -38,7 +38,7 @@ def main(): manager.manager.restoresession() manager.manager.startup() - emit("run") + emit("scion-begin") #settings.get("loop")() diff --git a/src/core/cli.py b/src/core/cli.py index 19b39fbd..943287e0 100644 --- a/src/core/cli.py +++ b/src/core/cli.py @@ -29,8 +29,8 @@ class Plugin(plugin.Plugin): cline.history.read() # Register our run function and close function - register("run", cline.loop.loop) - register("quit", cline.loop.quit) + register("scion-begin", cline.loop.loop) + register("scion-end", cline.loop.quit) # Initialize a dictionary for key press inputs settings.set("keyinput", dict()) @@ -45,6 +45,8 @@ class Plugin(plugin.Plugin): cline.history.save() write("CLI has been stopped", True) settings.delete("keyinput") + remove("scion-begin",cline.loop.loop) + remove("scion-end",cline.loop.quit) def run(self,args): diff --git a/src/core/cline/loop.py b/src/core/cline/loop.py index e2ec2ca5..5093d1a6 100644 --- a/src/core/cline/loop.py +++ b/src/core/cline/loop.py @@ -44,7 +44,7 @@ def init(): settings.set("clinex", 0) settings.set("cliney", 0) - register("write", insert,90) + register("message-write", insert,90) @@ -72,7 +72,7 @@ def quit(): #settings.delete("everyloop") # Return to previous write function - remove("write",insert) + remove("message-write",insert) #settings.pop("write") write("Command line loop has ended",True) @@ -92,15 +92,12 @@ def loop(): disp(input) while halt == False: - emit("cliloop") - #list = settings.get("everyloop",True) - #if not list == None: - # for func in list: - # func() + emit("cli-loop-begin") try: input = addch(input) disp(input) except: pass + emit("cli-loop-end") diff --git a/src/core/cline/message.py b/src/core/cline/message.py index 49ab54ba..f6378cc7 100644 --- a/src/core/cline/message.py +++ b/src/core/cline/message.py @@ -42,7 +42,7 @@ def insert(string): stdscr.addstr(y, 0, string) advance(y, maxyx[0], stdscr) - bt.signal.stop("write") + bt.signal.stop("message-write") diff --git a/src/doc/newFeatures.txt b/src/doc/newFeatures.txt new file mode 100644 index 00000000..71ae036d --- /dev/null +++ b/src/doc/newFeatures.txt @@ -0,0 +1,9 @@ +Scion 1.3 New Features +---------------------- + +2 / 15 / 2010: +- Separate commands with semi-colon +- Documentation for signals began + +2 / 16 / 2010 +- Rename signals \ No newline at end of file diff --git a/src/doc/signals.txt b/src/doc/signals.txt index cf0489ce..fc5694c1 100644 --- a/src/doc/signals.txt +++ b/src/doc/signals.txt @@ -1,9 +1,38 @@ +Documentation for signals, and where they are emitted -cliloop - emitted in cline.loop.py, called at the beginning of every cli loop +cli-loop-begin: + Called at the beginning of every loop in the cli + Emitted in core.cline.loop.loop() + -quit - emitted in manager.py, ends the main loop and closes all plugins +cli-loop-end: + Called at the end of every loop in the cli + Emitted in core.cline.loop.loop() -run - emitted in scion.py, begins a main loop for the program -write - emitted in bt.message.py, displays text to the screen +message-write: + Displays text to the screen + Emitted in bt.message.write() + Registered in bt.message + Registered in core.cline.loop.init() + Removed in core.cline.loop.quit() + Stopped in core.cline.message.insert() + + +scion-begin: + Begins a main loop for the program. + Emitted in base.scion.main() + Registered in core.cli.Plugin.open() + Registered in extra.sgtk.Plugin.open() + Removed in core.cli.Plugin.close() + Removed in extra.sgtk.Plugin.close() + + +scion-end: + Ends the main loop and closes all plugins + Emitted in base.manager.shutdown() + Registered in core.cli.Plugin.open() + Registered in extra.sgtk.Plugin.open() + Removed in core.cli.Plugin.close() + Removed in extra.sgtk.Plugin.close() diff --git a/src/doc/todo.txt b/src/doc/todo.txt index c8f0c304..aeb537ad 100644 --- a/src/doc/todo.txt +++ b/src/doc/todo.txt @@ -3,25 +3,24 @@ Scion To-Do List - CLI tab completion - Add more signals -- Rename some signals - Scripting - Check during startup, register as callback if some token in first line - Run script if given as an input arg, then exit - Run script after a signal has executed - Variables (dict with name->string) - *.scion == scripts. Allow adding to list of extensions -- Separate commands with semi-colon - Settings.init() - Rename dirs scion/ core/ plugins/ scripts/ + util/ doc/ - Clean up sgtk, settings, loader, manager, cline -- Simple command line (no ncurses) +- Simple command line (no ncurses) (should work on windows after this) - Documentation - - Signals + - Signals (2/25/2010) - Setting variables - Scripts - Better way to list signals, aliases, and settings diff --git a/src/extra/sgtk.py b/src/extra/sgtk.py index d596ba3f..130111d5 100644 --- a/src/extra/sgtk.py +++ b/src/extra/sgtk.py @@ -28,8 +28,8 @@ class Plugin(plugin.Plugin): def open(self): #settings.set("guirunning",False) if settings.get("guirunning") == True: - signal.register("run",self.loop,90) - signal.register("quit",self.close,90) + signal.register("scion-begin",self.loop,90) + signal.register("scion-end",self.close,90) else: settings.set("guirunning",False) @@ -38,8 +38,8 @@ class Plugin(plugin.Plugin): if settings.get("guirunning") == True: gtk.main_quit() settings.delete("gtkfuncs") - signal.remove("run",self.loop) - signal.remove("quit",self.close) + signal.remove("scion-begin",self.loop) + signal.remove("scion-end",self.close) def run(self, args=None):