Renamed all my signals

This commit is contained in:
bjschuma 2010-02-16 23:49:18 -05:00
parent 1fda601f96
commit eacb1de5dc
10 changed files with 62 additions and 32 deletions

View File

@ -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)
bt.signal.register("message-write",disp)

View File

@ -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)

View File

@ -38,7 +38,7 @@ def main():
manager.manager.restoresession()
manager.manager.startup()
emit("run")
emit("scion-begin")
#settings.get("loop")()

View File

@ -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):

View File

@ -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")

View File

@ -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")

9
src/doc/newFeatures.txt Normal file
View File

@ -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

View File

@ -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()

View File

@ -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

View File

@ -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):