Commit 0c0159cd authored by Jérome Perrin's avatar Jérome Perrin

wrap long lines in BusinessTemplate_getModifiedObject



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@10458 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 2e020e64
...@@ -71,41 +71,61 @@ ...@@ -71,41 +71,61 @@
<value> <string>from Products.ERP5Type.Document import newTempBase\n <value> <string>from Products.ERP5Type.Document import newTempBase\n
from Products.ERP5Type.Cache import CachingMethod\n from Products.ERP5Type.Cache import CachingMethod\n
\n \n
#Check dependencies, raise exception if a dependency is missing\n
context.checkDependencies()\n
\n
def getModifiedObjectList(context):\n def getModifiedObjectList(context):\n
result = context.preinstall()\n result = context.preinstall()\n
context.log(\'getModifiedObjectList cache filled\',\'\')\n return result\n
return result \n
\n \n
getModifiedObjectList = CachingMethod(getModifiedObjectList, id=\'BusinessTemplate_getModifiedObjectList\', cache_duration=36000)\n getModifiedObjectList = CachingMethod(getModifiedObjectList,\n
id=\'BusinessTemplate_getModifiedObjectList\',\n
cache_duration=36000)\n
\n \n
modified_object_list = getModifiedObjectList(context)\n modified_object_list = getModifiedObjectList(context)\n
keys = modified_object_list.keys()\n keys = modified_object_list.keys()\n
keys.sort()\n keys.sort()\n
\n \n
no_backup_list = [\'Action\', \'SiteProperty\', \'Module\', \'Document\', \'PropertySheet\', \'Extension\', \'Test\', \'Product\', \n no_backup_list = [\'Action\', \'SiteProperty\', \'Module\', \'Document\',\n
\'Role\', \'CatalogResultKey\', \'CatalogRelatedKey\', \'CatalogResultTable\', \'MessageTranslation\', \'LocalRoles\', \n \'PropertySheet\', \'Extension\', \'Test\', \'Product\', \'Role\',\n
\'PortalTypeAllowedContentType\', \'PortalTypeHiddenContentType\', \'PortalTypePropertySheet\', \'PortalTypeBaseCategory\']\n \'CatalogResultKey\', \'CatalogRelatedKey\',\n
\'CatalogResultTable\', \'MessageTranslation\', \'LocalRoles\',\n
\'PortalTypeAllowedContentType\',\n
\'PortalTypeHiddenContentType\', \'PortalTypePropertySheet\',\n
\'PortalTypeBaseCategory\']\n
\n \n
i = 0\n i = 0\n
object_list = []\n object_list = []\n
for object_id in keys: \n for object_id in keys:\n
object_state, object_class = modified_object_list[object_id]\n object_state, object_class = modified_object_list[object_id]\n
line = newTempBase(context, \'tmp_install_%s\' %(str(i)))\n line = newTempBase(context, \'tmp_install_%s\' %(str(i)))\n
if object_state == \'New\':\n if object_state == \'New\':\n
line.edit(object_id=object_id, object_state=object_state, object_class=object_class, choice_item_list=[[\'Install\', \'install\'], [\'Do Nothing\', \'nothing\']])\n line.edit(object_id=object_id, object_state=object_state,\n
object_class=object_class,\n
choice_item_list=[[\'Install\', \'install\'],\n
[\'Do Nothing\', \'nothing\']])\n
elif object_state == \'Modified\':\n elif object_state == \'Modified\':\n
if object_class in no_backup_list:\n if object_class in no_backup_list:\n
line.edit(object_id=object_id, object_state=object_state, object_class=object_class, choice_item_list=[[\'Upgrade\', \'install\'], [\'Keep Original\', \'nothing\']])\n line.edit(object_id=object_id, object_state=object_state,\n
object_class=object_class,\n
choice_item_list=[[\'Upgrade\', \'install\'],\n
[\'Keep Original\', \'nothing\']])\n
else:\n else:\n
line.edit(object_id=object_id, object_state=object_state, object_class=object_class, choice_item_list=[[\'Backup And Upgrade\', \'backup\'], [\'Upgrade\', \'install\'], [\'Keep Original\', \'nothing\']])\n line.edit(object_id=object_id, object_state=object_state,\n
object_class=object_class,\n
choice_item_list=[[\'Backup And Upgrade\', \'backup\'],\n
[\'Upgrade\', \'install\'],\n
[\'Keep Original\', \'nothing\']])\n
elif object_state == \'Removed\':\n elif object_state == \'Removed\':\n
if object_class in no_backup_list:\n if object_class in no_backup_list:\n
line.edit(object_id=object_id, object_state=object_state, object_class=object_class, choice_item_list=[[\'Remove\', \'remove\'], [\'Keep Original\', \'nothing\']])\n line.edit(object_id=object_id,\n
object_state=object_state,\n
object_class=object_class,\n
choice_item_list=[[\'Remove\', \'remove\'],\n
[\'Keep Original\', \'nothing\']])\n
else:\n else:\n
line.edit(object_id=object_id, object_state=object_state, object_class=object_class, choice_item_list=[[\'Backup And Remove\', \'save_and_remove\'], [\'Remove\', \'remove\'], [\'Keep Original\', \'nothing\']])\n line.edit(object_id=object_id, object_state=object_state,\n
object_class=object_class,\n
choice_item_list=[[\'Backup And Remove\', \'save_and_remove\'],\n
[\'Remove\', \'remove\'],\n
[\'Keep Original\', \'nothing\']])\n
line.setUid(\'new_%s\' % object_id)\n line.setUid(\'new_%s\' % object_id)\n
object_list.append(line)\n object_list.append(line)\n
i += 1 \n i += 1 \n
...@@ -164,10 +184,10 @@ return object_list\n ...@@ -164,10 +184,10 @@ return object_list\n
<string>newTempBase</string> <string>newTempBase</string>
<string>Products.ERP5Type.Cache</string> <string>Products.ERP5Type.Cache</string>
<string>CachingMethod</string> <string>CachingMethod</string>
<string>_getattr_</string>
<string>context</string>
<string>getModifiedObjectList</string> <string>getModifiedObjectList</string>
<string>context</string>
<string>modified_object_list</string> <string>modified_object_list</string>
<string>_getattr_</string>
<string>keys</string> <string>keys</string>
<string>no_backup_list</string> <string>no_backup_list</string>
<string>i</string> <string>i</string>
......
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