[Erp5-report] r38444 yo - in /erp5/trunk/bt5/erp5_base: SkinTemplateItem/portal_skins/erp5_...
nobody at svn.erp5.org
nobody at svn.erp5.org
Fri Sep 17 11:22:01 CEST 2010
Author: yo
Date: Fri Sep 17 11:21:56 2010
New Revision: 38444
URL: http://svn.erp5.org?rev=38444&view=rev
Log:
2010-09-17 yo
* Add an utility script BusinessPath_build which can be used to unify the way of invoking global builds.
Added:
erp5/trunk/bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/BusinessPath_build.xml
Modified:
erp5/trunk/bt5/erp5_base/bt/change_log
erp5/trunk/bt5/erp5_base/bt/revision
Added: erp5/trunk/bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/BusinessPath_build.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/BusinessPath_build.xml?rev=38444&view=auto
==============================================================================
--- erp5/trunk/bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/BusinessPath_build.xml (added)
+++ erp5/trunk/bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/BusinessPath_build.xml [utf8] Fri Sep 17 11:21:56 2010
@@ -0,0 +1,170 @@
+<?xml version="1.0"?>
+<ZopeData>
+ <record id="1" aka="AAAAAAAAAAE=">
+ <pickle>
+ <global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
+ </pickle>
+ <pickle>
+ <dictionary>
+ <item>
+ <key> <string>Script_magic</string> </key>
+ <value> <int>3</int> </value>
+ </item>
+ <item>
+ <key> <string>_bind_names</string> </key>
+ <value>
+ <object>
+ <klass>
+ <global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
+ </klass>
+ <tuple/>
+ <state>
+ <dictionary>
+ <item>
+ <key> <string>_asgns</string> </key>
+ <value>
+ <dictionary>
+ <item>
+ <key> <string>name_container</string> </key>
+ <value> <string>container</string> </value>
+ </item>
+ <item>
+ <key> <string>name_context</string> </key>
+ <value> <string>context</string> </value>
+ </item>
+ <item>
+ <key> <string>name_m_self</string> </key>
+ <value> <string>script</string> </value>
+ </item>
+ <item>
+ <key> <string>name_subpath</string> </key>
+ <value> <string>traverse_subpath</string> </value>
+ </item>
+ </dictionary>
+ </value>
+ </item>
+ </dictionary>
+ </state>
+ </object>
+ </value>
+ </item>
+ <item>
+ <key> <string>_body</string> </key>
+ <value> <string># This script is a helper to perform a global build safely.\n
+\n
+builder = context.getDeliveryBuilderValue()\n
+if builder is None:\n
+ raise RuntimeError(\'No delivery builder available in the business path %s\' % (context.getPath(),))\n
+\n
+# The key points are:\n
+#\n
+# - that making multiple deliveries when they should be merged must be avoided (safety)\n
+# - that waiting for unrelated active objects to be finished should be avoided (low latency)\n
+#\n
+# There are two case worth considering. One of them is where new deliveries may be created.\n
+# In this case, we must make sure that multiple builder processes (whether the same builder\n
+# or different builders) would not run against the same delivery portal type under the same\n
+# module, because they might need to merge deliveries. This case is a bit complicated, as\n
+# delivery select methods often depend on the catalog, thus it is necessary to wait for\n
+# the indexing of new deliveries.\n
+#\n
+# The other case is where no new deliveries may be created. This is typical when using\n
+# trade model lines or simplified accounting. In this case, we only need to make sure that\n
+# the same builder would not run in parallel, because the result is unpredictable when\n
+# the builder selects the same movements. Besides that, there is no risk to run the builder,\n
+# as the builder does no harm, even if it could not find updatable deliveries.\n
+if builder.getDeliveryCreatable():\n
+ module_id = builder.getDeliveryModule()\n
+ delivery_portal_type = builder.getDeliveryPortalType()\n
+ serialization_tag = \'build:%s:%s\' % (module_id, delivery_portal_type)\n
+ indexing_tag = \'indexing:%s:%s\' % (module_id, delivery_portal_type)\n
+ after_tag = indexing_tag\n
+ # XXX actually, this parameter is used even for lines and cells as well as only modifying\n
+ # existing deliveries. So this implies that the builder may still wait unnecessarily.\n
+ activate_kw = dict(tag=indexing_tag)\n
+else:\n
+ builder_uid = builder.getUid()\n
+ serialization_tag = \'build:%s\' % (builder_uid)\n
+ after_tag = None\n
+ activate_kw = None\n
+\n
+builder.activate(serialization_tag=serialization_tag, after_tag=after_tag) \\\n
+ .build(activate_kw=activate_kw)\n
+</string> </value>
+ </item>
+ <item>
+ <key> <string>_code</string> </key>
+ <value>
+ <none/>
+ </value>
+ </item>
+ <item>
+ <key> <string>_params</string> </key>
+ <value> <string>**kw</string> </value>
+ </item>
+ <item>
+ <key> <string>errors</string> </key>
+ <value>
+ <tuple/>
+ </value>
+ </item>
+ <item>
+ <key> <string>func_code</string> </key>
+ <value>
+ <object>
+ <klass>
+ <global name="FuncCode" module="Shared.DC.Scripts.Signature"/>
+ </klass>
+ <tuple/>
+ <state>
+ <dictionary>
+ <item>
+ <key> <string>co_argcount</string> </key>
+ <value> <int>0</int> </value>
+ </item>
+ <item>
+ <key> <string>co_varnames</string> </key>
+ <value>
+ <tuple>
+ <string>kw</string>
+ <string>_getattr_</string>
+ <string>context</string>
+ <string>builder</string>
+ <string>None</string>
+ <string>RuntimeError</string>
+ <string>module_id</string>
+ <string>delivery_portal_type</string>
+ <string>serialization_tag</string>
+ <string>indexing_tag</string>
+ <string>after_tag</string>
+ <string>dict</string>
+ <string>activate_kw</string>
+ <string>builder_uid</string>
+ </tuple>
+ </value>
+ </item>
+ </dictionary>
+ </state>
+ </object>
+ </value>
+ </item>
+ <item>
+ <key> <string>func_defaults</string> </key>
+ <value>
+ <none/>
+ </value>
+ </item>
+ <item>
+ <key> <string>id</string> </key>
+ <value> <string>BusinessPath_build</string> </value>
+ </item>
+ <item>
+ <key> <string>warnings</string> </key>
+ <value>
+ <tuple/>
+ </value>
+ </item>
+ </dictionary>
+ </pickle>
+ </record>
+</ZopeData>
Modified: erp5/trunk/bt5/erp5_base/bt/change_log
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_base/bt/change_log?rev=38444&r1=38443&r2=38444&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_base/bt/change_log [utf8] (original)
+++ erp5/trunk/bt5/erp5_base/bt/change_log [utf8] Fri Sep 17 11:21:56 2010
@@ -1,4 +1,7 @@
2010-09-17 yo
+* Add an utility script BusinessPath_build which can be used to unify the way of invoking global builds.
+
+2010-09-17 yo
* Add a flag to specify if a delivery builder may create any new deliveries or not.
2010-08-09 nicolas.dumazet
Modified: erp5/trunk/bt5/erp5_base/bt/revision
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_base/bt/revision?rev=38444&r1=38443&r2=38444&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_base/bt/revision [utf8] (original)
+++ erp5/trunk/bt5/erp5_base/bt/revision [utf8] Fri Sep 17 11:21:56 2010
@@ -1 +1 @@
-843
\ No newline at end of file
+845
\ No newline at end of file
More information about the Erp5-report
mailing list