Commit 8b8bba5d authored by Rafael Monnerat's avatar Rafael Monnerat

erp5_administration: make dump scripts more flexible

    This allow including more items to be ignored, preventing diffs from pure development.
parent 783b561c
import hashlib import hashlib
portal = context.getPortalObject() portal = context.getPortalObject()
if ignore_folder_list is None:
ignore_folder_list = []
if ignore_skin_list is None:
ignore_skin_list = []
if ignore_custom:
ignore_folder_list.append("custom")
def getSkinHash(skin, skin_container): def getSkinHash(skin, skin_container):
content = '' content = ''
...@@ -24,9 +32,11 @@ def getSkinHash(skin, skin_container): ...@@ -24,9 +32,11 @@ def getSkinHash(skin, skin_container):
for skin_folder in portal.portal_skins.objectValues('Folder'): for skin_folder in portal.portal_skins.objectValues('Folder'):
if ignore_custom and skin_folder.getId() == 'custom': if skin_folder.getId() in ignore_folder_list:
continue continue
for skin in skin_folder.objectValues(): for skin in skin_folder.objectValues():
if skin.getId() in ignore_skin_list:
continue
print getSkinHash(skin, skin_folder) print getSkinHash(skin, skin_folder)
if include_workflow_scripts: if include_workflow_scripts:
......
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>ignore_custom=True, include_workflow_scripts=True</string> </value> <value> <string>ignore_custom=True, include_workflow_scripts=True, ignore_folder_list=None, ignore_skin_list=None</string> </value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
......
if ignore_property_sheet_list is None:
ignore_property_sheet_list = []
for ps in sorted(context.getPortalObject().portal_property_sheets.contentValues(), key=lambda x:x.getId()): for ps in sorted(context.getPortalObject().portal_property_sheets.contentValues(), key=lambda x:x.getId()):
for pd in sorted(ps.contentValues(), key=lambda x:x.getId()): for pd in sorted(ps.contentValues(), key=lambda x:x.getId()):
ps_id = ps.getId()
if ps_id in ignore_property_sheet_list:
continue
print ps.getId() print ps.getId()
info_list = ['id', 'portal_type', 'reference'] info_list = ['id', 'portal_type', 'reference']
std_prop_list = ['elementary_type', 'property_default', 'storage_id', 'multivaluated', 'range', 'preference', 'read_permission', 'write_permission', 'translatable', 'translation_domain'] std_prop_list = ['elementary_type', 'property_default', 'storage_id', 'multivaluated', 'range', 'preference', 'read_permission', 'write_permission', 'translatable', 'translation_domain']
......
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string></string> </value> <value> <string>ignore_property_sheet_list=None</string> </value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
......
...@@ -10,5 +10,8 @@ ...@@ -10,5 +10,8 @@
skin_tool = context.getPortalObject().portal_skins skin_tool = context.getPortalObject().portal_skins
for name, layers in skin_tool.getSkinPaths(): for name, layers in skin_tool.getSkinPaths():
for layer in layers.split(','): for layer in layers.split(','):
if ignore_skin_folder_list is not None and\
layer in ignore_skin_folder_list:
continue
print '%s,%s' % (name, layer) print '%s,%s' % (name, layer)
return printed return printed
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string></string> </value> <value> <string>ignore_skin_folder_list=None</string> </value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
......
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