• Douglas's avatar
    erp5_data_notebook: moves variables and setup storage from ActiveProcess to... · 11eb5168
    Douglas authored
    erp5_data_notebook: moves variables and setup storage from ActiveProcess to `notebook_context` property
    
    Notebook's variables and setup were being stored in an ActiveProcess, which is
    not needed anymore, because now everything related to user context can be
    safely stored in the ZODB.
    They are stored in a `notebook_context` property of the Data Notebook
    itself. Code and tests were updated properly. The old `process` property was removed.
    
    All the references to *_variable_dict were renamed to  *_notebook_context, documentation
    and tests were updated. Related objects like scripts and external methods were renamed
    too.
    
    To store objects in the `notebook_context` property we do 2 different tests: the first
    to check if the object can be serialized by `ZODB.serialize.ObjectWriter`. If the first
    test fails we test if the object can be serialized by cPickle. For the second test we
    need to dump & load the object to be completely sure that it can be correctly loaded
    later.
    
    The function called by the Base_runJupyterCode external method was renamed from
    Base_compileJupyterCode to Base_runJupyterCode be more consistent and avoid confusion.
    
    All errors while running setup functions and now properly propagated to the user
    interface in Jupyter and code execution is aborted.
    11eb5168
extension.erp5.JupyterCompile.py 28.8 KB