Discussion:
[Erp5-dev] Patches to make XML representation of BT more stable
Julien Muchembled
2008-08-27 15:22:42 UTC
Permalink
Hello,


Business Templates and ERP5 Subversion are very unfriendly because of several problems:
* wrong and unstable indentation
* several useless attributes appear and disappear
* dynamic data for certain meta types:
* Z SQL Methods: 'template' attribute (containing a copy of the source)
* Script (Python): func_code & func_defaults

Here are a few patches fixing them:

* 01_bt_indentation.patch
This fixes the problem related to indendation.
Indentation spaces mustn't be kept in cache (Immutable).

* 02_bt_common_attr.patch
Really remove '_filepath', '_owner', 'uid' and '__ac_local_roles__' attributes instead of setting to None when they are defined on the object.

Both 01_bt_indentation and 02_bt_common_attr patches are backward & forward compatible.

* 03_bt_ZSQLMethod.patch (to apply after 02_bt_common_attr.patch)
Remove the 'template' property. It must be computed again on import.

* 04_bt_PythonScript.patch (to apply after 03_bt_ZSQLMethod.patch)
Remove func_code & func_defaults. Really remove the '_code' attribute.
The script must always be recompiled on import.
For unit tests, I had to rewrite the mechanism of lazy compilation.

03_bt_ZSQLMethod.patch and 04_bt_PythonScript.patch are backward compatible but not forward compatible.
(This means that old code won't be able to import cleaned BT)


Patches have tested and I am ready to apply them.
However, this means that everybody should update their product at the same time.


Julien Muchembled

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 01_bt_indentation.patch
URL: <http://mail.tiolive.com/pipermail/erp5-dev/attachments/20080827/7ec354a6/attachment.asc>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 02_bt_common_attr.patch
URL: <http://mail.tiolive.com/pipermail/erp5-dev/attachments/20080827/7ec354a6/attachment.txt>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 03_bt_ZSQLMethod.patch
URL: <http://mail.tiolive.com/pipermail/erp5-dev/attachments/20080827/7ec354a6/attachment-0001.asc>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 04_bt_PythonScript.patch
URL: <http://mail.tiolive.com/pipermail/erp5-dev/attachments/20080827/7ec354a6/attachment-0001.txt>
Yoshinori Okuji
2008-08-28 10:28:29 UTC
Permalink
Hello,

Thank you for your patches. For now, I prefer to apply only perfectly
compatible patches. My plan is to make next version (5.2) in 2-3 weeks. I'd
recommend waiting until this is done before applying the rest.

YO
Post by Julien Muchembled
Hello,
Business Templates and ERP5 Subversion are very unfriendly because of
several problems: * wrong and unstable indentation
* several useless attributes appear and disappear
* Z SQL Methods: 'template' attribute (containing a copy of the source)
* Script (Python): func_code & func_defaults
* 01_bt_indentation.patch
This fixes the problem related to indendation.
Indentation spaces mustn't be kept in cache (Immutable).
* 02_bt_common_attr.patch
Really remove '_filepath', '_owner', 'uid' and '__ac_local_roles__'
attributes instead of setting to None when they are defined on the object.
Both 01_bt_indentation and 02_bt_common_attr patches are backward & forward compatible.
* 03_bt_ZSQLMethod.patch (to apply after 02_bt_common_attr.patch)
Remove the 'template' property. It must be computed again on import.
* 04_bt_PythonScript.patch (to apply after 03_bt_ZSQLMethod.patch)
Remove func_code & func_defaults. Really remove the '_code' attribute.
The script must always be recompiled on import.
For unit tests, I had to rewrite the mechanism of lazy compilation.
03_bt_ZSQLMethod.patch and 04_bt_PythonScript.patch are backward compatible
but not forward compatible. (This means that old code won't be able to
import cleaned BT)
Patches have tested and I am ready to apply them.
However, this means that everybody should update their product at the same time.
Julien Muchembled
--
Yoshinori Okuji, Nexedi KK President / Nexedi SA CTO
Nexedi: Consulting and Development of Free / Open Source Software
http://www.nexedi.co.jp/
ERP5: Full Featured High End Open Source ERP
http://www.erp5.com/
ERP5 Wiki: Developer Zone for ERP5 Community
http://www.erp5.org/
Julien Muchembled
2008-09-11 18:37:55 UTC
Permalink
Hello,
Post by Yoshinori Okuji
Thank you for your patches. For now, I prefer to apply only perfectly
compatible patches. My plan is to make next version (5.2) in 2-3 weeks. I'd
recommend waiting until this is done before applying the rest.
OK.
I've just applied the first 2 patches.

To avoid that cleaned objects are dirtied again, everybody should update
erp5/trunk/products/ERP5/Document/BusinessTemplate.py
erp5/trunk/products/ERP5Type/patches/ppml.py
or apply r23576 manually.


Julien Muchembled

Loading...