- 08 Jul, 2016 1 commit
-
-
Douglas authored
Variables are investigated, recursively in case of container objects (like lists, for example), to detect if they can be stored in the ZODB. In this investigation persistent objects are identified by being an instance of the object class and implementing a `__getstate__` method that raises no exception. If the variable is not a Persistent object then we try to pickle and load it. While developing the pickleable object identification a complication was found. It seems that the code cannot capture cPickle.PicklingError in the usual way, `except cPickle.PicklingError`. It's consequence of some weirdness with regards to pickle/cPickle modules exceptions classes and more about it can be read at http://bugs.python.org/issue1457119. So, the workaround for this complication was to catch all exceptions and check the exception class name as string. The whole check for zodb persistence was moved into an utility function for the sake of readability and code maintenance. The Base_executeJupyter script object was transformed into an extension to be able to properly handle transaction errors and render them correctly inside Jupyter.
-
- 29 Jun, 2016 2 commits
-
-
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.
-
Douglas authored
- An environment object was implemented to help us deal with the multiprocess architecture of ERP5 and objects that cannot be easily stored in the ZODB. It stores definition of functions, classes and variables as string. The implementation uses a dumb Environment class to allow users to make `define` and `undefine` calls, which are captured and processed by an AST transformer before code execution. - Along with the environment object, an automatic "import fixer" was created. It does not allow users to import modules as they normally would, because this may cause collateral effects on other users' code. A good example is the plot settings in the matplotlib module. It will fix normal imports, make them use the environment object mentione earlier automatically and warn the user about it. A few bugs were fixed with this implementation, for example: - https://nexedi.erp5.net/bug_module/20160318-7098DD, which reports an inconsistency on portal catalog queries between Jupyter and Python (Script) objects. Probably an issue with user context storage in ActiveProcess - https://nexedi.erp5.net/bug_module/20160330-13AA193, which reports an error related to acquisition when trying to plot images, which happened in other situations, although this is not officially reported in Nexedi's ERP5. This probably also was happening because of old user context storage.
-
- 17 Jun, 2016 5 commits
-
-
Cédric Le Ninivin authored
-
Tristan Cavelier authored
- normalize path to avoid to traverse with wrong value - review KeyError message when domain is unknown - use getWebSiteValue when possible /reviewed-on nexedi/erp5!124
-
Tristan Cavelier authored
-
Tristan Cavelier authored
-
Tristan Cavelier authored
-
- 15 Jun, 2016 2 commits
-
-
Romain Courteaud authored
-
Cédric Le Ninivin authored
-
- 14 Jun, 2016 6 commits
-
-
Cédric Le Ninivin authored
-
Romain Courteaud authored
Dependency should be defined directly on bt5 if needed.
-
Julien Muchembled authored
'keep_existing' argument of Base._edit has never been used and we should consider removing it.
-
iv authored
When defining a guard on an object, calling a method such as Base_viewDict on that object could be denied due to guard acquisition.
-
Cédric Le Ninivin authored
-
Xiaowu Zhang authored
-
- 13 Jun, 2016 5 commits
-
-
Julien Muchembled authored
- the check is moved to a less performance-critical place - getPortalObject was forgotten in commit d8e9ed19
-
Julien Muchembled authored
-
Julien Muchembled authored
- 'apply' causes a break in cProfile results - 'apply' is deprecated (removed in Python 3)
-
Romain Courteaud authored
-
Jérome Perrin authored
* reference * translated_title * the usual owner_title, creation_date and modification_date * remove useless listbox_editable_fields that are defined in the field library This business template does not seem to follow the guideline yet
-
- 10 Jun, 2016 5 commits
-
-
Julien Muchembled authored
-
Julien Muchembled authored
-
Julien Muchembled authored
-
Jérome Perrin authored
-
Jérome Perrin authored
-
- 09 Jun, 2016 14 commits
-
-
Julien Muchembled authored
For example, Python Scripts were: - dirty in the imported BT (causing all of them to be reinstalled on upgrade) - compiled to return None
-
Cédric Le Ninivin authored
-
Cédric Le Ninivin authored
-
Cédric Le Ninivin authored
-
Jérome Perrin authored
When a currency exchange line is (in)validated, we need to reindex the currency exchange cells that acquire validation state from the currency exchange line.
-
Jérome Perrin authored
-
Jérome Perrin authored
This allows defining an exchange rate without end date
-
Cédric Le Ninivin authored
-
Cédric Le Ninivin authored
-
Cédric Le Ninivin authored
-
Cédric Le Ninivin authored
-
Romain Courteaud authored
-
-
Jérome Perrin authored
-