Browse Source

two more hooks: on_load and on_exit

adam j hartz 1 year ago
parent
commit
03efe4f268
1 changed files with 3 additions and 0 deletions
  1. 3
    0
      takoshell/main.py

+ 3
- 0
takoshell/main.py View File

@@ -33,6 +33,7 @@ from takoshell.shell import Shell
33 33
 from takoshell.pretty import pretty
34 34
 from takoshell.proc import HiddenCompletedCommand
35 35
 from takoshell.jobs import ignore_sigtstp
36
+from takoshell.events import fire_event
36 37
 from takoshell.environ import takorc_context
37 38
 from takoshell.codecache import run_script_with_cache, run_code_with_cache
38 39
 
@@ -198,6 +199,7 @@ def main(argv=None):
198 199
     if argv is None:
199 200
         argv = sys.argv[1:]
200 201
     args = premain(argv)
202
+    fire_event('on_load')
201 203
     env = builtins.__tako_env__
202 204
     shell = builtins.__tako_shell__
203 205
     never_print = os.path.isfile(os.path.join(env['XDG_CONFIG_HOME'], 'tako', 'suppress_message'))
@@ -231,6 +233,7 @@ def main(argv=None):
231 233
         env['TAKO_INTERACTIVE'] = True
232 234
         ignore_sigtstp()
233 235
         shell.cmdloop()
236
+    fire_event('on_exit')
234 237
     postmain(args)
235 238
 
236 239
 

Loading…
Cancel
Save