Commit 03efe4f2 authored by adam j hartz's avatar adam j hartz

two more hooks: on_load and on_exit

parent aa3e9629
......@@ -33,6 +33,7 @@ from takoshell.shell import Shell
from takoshell.pretty import pretty
from takoshell.proc import HiddenCompletedCommand
from takoshell.jobs import ignore_sigtstp
from takoshell.events import fire_event
from takoshell.environ import takorc_context
from takoshell.codecache import run_script_with_cache, run_code_with_cache
......@@ -198,6 +199,7 @@ def main(argv=None):
if argv is None:
argv = sys.argv[1:]
args = premain(argv)
fire_event('on_load')
env = builtins.__tako_env__
shell = builtins.__tako_shell__
never_print = os.path.isfile(os.path.join(env['XDG_CONFIG_HOME'], 'tako', 'suppress_message'))
......@@ -231,6 +233,7 @@ def main(argv=None):
env['TAKO_INTERACTIVE'] = True
ignore_sigtstp()
shell.cmdloop()
fire_event('on_exit')
postmain(args)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment