Commit 3bb1b06e authored by Łukasz Nowak's avatar Łukasz Nowak

Use custom, non conflicting module cleanup.

parent de8e4167
...@@ -50,8 +50,12 @@ ...@@ -50,8 +50,12 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>portal = context.getPortalObject()\n <value> <string encoding="cdata"><![CDATA[
portal = context.getPortalObject()\n
tag = script.id\n tag = script.id\n
if portal.portal_activities.countMessageWithTag(tag) > 0:\n
raise TypeError(\'Already running\')\n
method_id = \'Instance_migrateData\'\n method_id = \'Instance_migrateData\'\n
for module in (\n for module in (\n
portal.hosting_subscription_module,\n portal.hosting_subscription_module,\n
...@@ -66,7 +70,9 @@ for module in (\n ...@@ -66,7 +70,9 @@ for module in (\n
)\n )\n
\n \n
return \'Done.\'\n return \'Done.\'\n
</string> </value>
]]></string> </value>
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
......
...@@ -50,8 +50,12 @@ ...@@ -50,8 +50,12 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>portal = context.getPortalObject()\n <value> <string encoding="cdata"><![CDATA[
portal = context.getPortalObject()\n
tag = script.id\n tag = script.id\n
if portal.portal_activities.countMessageWithTag(tag) > 0:\n
raise TypeError(\'Already running\')\n
method_id = \'Computer_migrateCategory\'\n method_id = \'Computer_migrateCategory\'\n
for module in (\n for module in (\n
portal.computer_module,\n portal.computer_module,\n
...@@ -65,7 +69,9 @@ for module in (\n ...@@ -65,7 +69,9 @@ for module in (\n
)\n )\n
\n \n
return \'Done.\'\n return \'Done.\'\n
</string> </value>
]]></string> </value>
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
......
...@@ -52,12 +52,19 @@ ...@@ -52,12 +52,19 @@
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string encoding="cdata"><![CDATA[ <value> <string encoding="cdata"><![CDATA[
BLACKLIST_RELATIVE_URL_LIST = (\n
\'accounting_module/template_sale_invoice_transaction\',\n
\'open_sale_order_module/slapos_accounting_open_sale_order_line_template\',\n
\'open_sale_order_module/slapos_accounting_open_sale_order_template\',\n
\'sale_packing_list_module/slapos_accounting_instance_delivery_line_template\',\n
\'sale_packing_list_module/slapos_accounting_instance_delivery_template\',\n
\'sale_trade_condition_module/payzen_sale_trade_condition\',\n
\'sale_trade_condition_module/slapos_aggregated_trade_condition\',\n
\'sale_trade_condition_module/slapos_consumption_trade_condition\',\n
\'sale_trade_condition_module/slapos_subscription_trade_condition\',\n
)\n
portal = context.getPortalObject()\n portal = context.getPortalObject()\n
tag = script.id\n module_list = (\n
if portal.portal_activities.countMessageWithTag(tag) > 0:\n
raise TypeError(\'Already running\')\n
method_id = \'Base_deleteGrouped\'\n
for module in (\n
portal.accounting_module,\n portal.accounting_module,\n
portal.internal_packing_list_module,\n portal.internal_packing_list_module,\n
portal.open_sale_order_module,\n portal.open_sale_order_module,\n
...@@ -66,22 +73,31 @@ for module in (\n ...@@ -66,22 +73,31 @@ for module in (\n
portal.sale_order_module,\n portal.sale_order_module,\n
portal.sale_packing_list_module,\n portal.sale_packing_list_module,\n
portal.sale_trade_condition_module,\n portal.sale_trade_condition_module,\n
):\n
portal.portal_catalog.searchAndActivate(\n
parent_uid=module.getUid(),\n
method_id=method_id,\n
packet_size=20,\n
activity_count=1,\n
activate_kw={\'tag\': tag}\n
)\n )\n
return \'Done.\'\n tag = script.id\n
if bg:\n
if portal.portal_activities.countMessageWithTag(tag) > 0:\n
raise TypeError(\'Already running\')\n
for module in module_list:\n
getattr(module.activate(tag=tag), \'03_ERP5Site_deleteVifibAccounting\')(bg=0)\n
return \'Done.\'\n
\n
deleted = False\n
if context in module_list:\n
id_list = [q.getId() for q in context.contentValues()[:20] if q.getRelativeUrl() not in BLACKLIST_RELATIVE_URL_LIST]\n
if id_list:\n
deleted = True\n
context.deleteContent(id_list)\n
\n
if deleted:\n
getattr(context.activate(tag=tag), \'03_ERP5Site_deleteVifibAccounting\')(bg=0)\n
]]></string> </value> ]]></string> </value>
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string></string> </value> <value> <string>bg=1</string> </value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
......
<?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>return getattr(context.getPortalObject(), \'03_ERP5Site_deleteVifibAccounting\')()\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>05_ERP5Site_deleteVifibAccounting</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -79,7 +79,7 @@ return \'Done.\'\n ...@@ -79,7 +79,7 @@ return \'Done.\'\n
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>06_ERP5Site_updateLocalRoles</string> </value> <value> <string>05_ERP5Site_updateLocalRoles</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -60,7 +60,7 @@ return \'Done.\'\n ...@@ -60,7 +60,7 @@ return \'Done.\'\n
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>07_ERP5Site_reindexWithClear</string> </value> <value> <string>06_ERP5Site_reindexWithClear</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
<?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>BLACKLIST_RELATIVE_URL_LIST = (\n
\'accounting_module/template_sale_invoice_transaction\',\n
\'open_sale_order_module/slapos_accounting_open_sale_order_line_template\',\n
\'open_sale_order_module/slapos_accounting_open_sale_order_template\',\n
\'sale_packing_list_module/slapos_accounting_instance_delivery_line_template\',\n
\'sale_packing_list_module/slapos_accounting_instance_delivery_template\',\n
\'sale_trade_condition_module/payzen_sale_trade_condition\',\n
\'sale_trade_condition_module/slapos_aggregated_trade_condition\',\n
\'sale_trade_condition_module/slapos_consumption_trade_condition\',\n
\'sale_trade_condition_module/slapos_subscription_trade_condition\',\n
)\n
\n
document = context\n
if document.getRelativeUrl() in BLACKLIST_RELATIVE_URL_LIST:\n
script.log(\'Not deleted blacklisted %s\' % document.getRelativeUrl())\n
return\n
document.getParentValue().deleteContent(document.getId())\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Base_deleteGrouped</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
45 46
\ No newline at end of file \ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment