Session refactoring
As discussed during our meeting today, here are the tasks related to Session refactoring:
TODO
-
add child-sessions
toSession
config. plugin to be able to compose sessions - list of session objects names - when the parent session is initialized, it will first initialize its children (depth search) - initializing = loading objects and executing session setup - /!\ important: check cycles, sessions must be unique in the sessions tree formed by parent and children - /!\ session cannot include itself -
make sure child-sessions
work likeconfig-objects
andexclude-objects
-
forbid session in config objects list -
remove the ability to compose sessions from the bliss
command line -
display entire sessions tree when doing --show-sessions
(liketree
Unix program) -
remove meaning of default
flag in session .yml files - make sureDEFAULT_SESSION
global always points to the root session -
add session
keyword argument toload_script()
function - by default,session
isNone
= load script from root session - for the record,load_script
should do 1. atry
...except
with exception display when loading script file, to prevent execution from stopping in case of error in a script 2. export only "public" names (ignore those starting with_
) 3. at session initialization: does the equivalent of Pythonimport
, at prompt: does a reload of the script -
the magic script import with the custom Importer
that generate dynamic modules should work like this: --from bliss.session.scripts.<session_name> import <script_name>
from bliss.session.<session_name> import <script_name>
-this can be achieved by creating an emptyscripts
package (only a directory with__init__.py
) inbliss/session
directory and attaching the dynamically created modules toscripts
package
Extra thing: link with #189 (closed): finally we may need a default, "empty" session when bliss
is started without any session specified on the command line.
DONE CRITERIA
- all features explained above have corresponding tests, and tests pass
Edited by Sebastien Petitdemange