Commit eb81fb79 authored by Sebastien Robin's avatar Sebastien Robin

2009-11-19 Seb

* add scripts done by Romain and Yusei in order to compare proxy fields between two skin folders

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@30777 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 019db530
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
<tuple/>
</tuple>
</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>skin_folder = getattr(context.portal_skins, original_skin_name)\n
new_skin_folder = getattr(context.portal_skins, new_skin_name)\n
\n
for original_form in skin_folder.objectValues():\n
if (original_form.meta_type==\'ERP5 Form\' or original_form.meta_type==\'ERP5 Report\') and not original_form.getId().endswith(\'FieldLibrary\'):\n
new_form = getattr(new_skin_folder, original_form.id)\n
for original_field in original_form.objectValues():\n
new_field = getattr(new_form, original_field.id, None)\n
if new_field is None:\n
print "Missing %s in %s" % (original_field.id, new_form)\n
\n
else:\n
\n
original_value_dict, original_value_tales = context.Base_getFieldData(original_field)\n
\n
try:\n
new_value_dict, new_value_tales = context.Base_getFieldData(new_field)\n
except AttributeError:\n
new_value_dict = new_value_tales = None\n
print "Dead proxy field %s %s" % (original_field.id, new_form)\n
\n
if new_value_dict is not None:\n
\n
if (original_value_dict != new_value_dict) or \\\n
(original_value_tales != new_value_tales):\n
\n
print new_form.id, new_field.id\n
\n
\n
for key, original_value in original_value_dict.items():\n
if original_value != new_value_dict[key]:\n
print " ", key, \'Origin: %s \' % original_value, \'New: %s \' % new_value_dict[key]\n
\n
for key, original_value in original_value_tales.items():\n
if original_value != new_value_tales[key]:\n
print " ", key, \'Origin: %s \' % original_value, \'New: %s \' % new_value_tales[key]\n
\n
# print \'\\n\'\n
\n
print \'OK\' \n
return printed\n
</string> </value>
</item>
<item>
<key> <string>_code</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>original_skin_name, new_skin_name</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>2</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>original_skin_name</string>
<string>new_skin_name</string>
<string>_print_</string>
<string>_print</string>
<string>getattr</string>
<string>_getattr_</string>
<string>context</string>
<string>skin_folder</string>
<string>new_skin_folder</string>
<string>_getiter_</string>
<string>original_form</string>
<string>new_form</string>
<string>original_field</string>
<string>None</string>
<string>new_field</string>
<string>original_value_dict</string>
<string>original_value_tales</string>
<string>new_value_dict</string>
<string>new_value_tales</string>
<string>AttributeError</string>
<string>key</string>
<string>original_value</string>
<string>_getitem_</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>Base_checkSkinFolderForms</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="ExternalMethod" module="Products.ExternalMethod.ExternalMethod"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_function</string> </key>
<value> <string>get_field_data</string> </value>
</item>
<item>
<key> <string>_module</string> </key>
<value> <string>proxy_field_util</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Base_getFieldData</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
535
\ No newline at end of file
536
\ 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