Commit 695f6ec2 authored by Jérome Perrin's avatar Jérome Perrin

2007-10-22 Jerome

* Added two utility scripts SkinsTool_checkDuplicateSelectionName and SkinsTool_getNotAssignedFieldList in erp5_toolbox

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@17081 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 58ed920f
<?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>Python_magic</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>__ac_local_roles__</string> </key>
<value>
<none/>
</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 encoding="cdata"><![CDATA[
"""Print all listbox that uses the same selection name.\n
"""\n
skins_tool = context.portal_skins\n
selection_name_dict = dict()\n
\n
for field_path, field in skins_tool.ZopeFind(\n
skins_tool, obj_metatypes=[\'ProxyField\', \'ListBox\'], search_sub=1):\n
if field.meta_type == \'ProxyField\':\n
if field.getRecursiveTemplateField().meta_type != \'ListBox\' \\\n
or field.is_delegated(\'selection_name\'):\n
continue\n
\n
selection_name_dict.setdefault(\n
field.get_value(\'selection_name\'), []).append(field_path)\n
\n
for selection_name, field_list in selection_name_dict.items():\n
if len(field_list) > 1:\n
print repr(selection_name), \'\\n\\t\', \'\\n\\t\'.join(field_list)\n
return printed\n
]]></string> </value>
</item>
<item>
<key> <string>_code</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_filepath</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></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>_print_</string>
<string>_print</string>
<string>_getattr_</string>
<string>context</string>
<string>skins_tool</string>
<string>dict</string>
<string>selection_name_dict</string>
<string>_getiter_</string>
<string>field_path</string>
<string>field</string>
<string>selection_name</string>
<string>field_list</string>
<string>len</string>
<string>repr</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>SkinsTool_checkDuplicateSelectionName</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="PythonScript" module="Products.PythonScripts.PythonScript"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Python_magic</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>__ac_local_roles__</string> </key>
<value>
<none/>
</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>"""Prints all fields that are in \'not assigned\' group.\n
This happens after updating a form where some fields have been added locally.\n
"""\n
\n
for form_path, form in context.ZopeFind(\n
context.portal_skins, obj_metatypes=[\'ERP5 Form\'], search_sub=1):\n
try:\n
groups = form.get_groups()\n
except AttributeError, e:\n
print "%s is broken: %s" % (form_path, e)\n
if \'not_assigned\' in groups:\n
print \'Not assigned fields in %s: %s\' % (form_path,\n
[f.getId() for f in form.get_fields_in_group(\'not_assigned\')])\n
\n
return printed\n
</string> </value>
</item>
<item>
<key> <string>_code</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_filepath</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></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>_print_</string>
<string>_print</string>
<string>_getiter_</string>
<string>_getattr_</string>
<string>context</string>
<string>form_path</string>
<string>form</string>
<string>groups</string>
<string>AttributeError</string>
<string>e</string>
<string>append</string>
<string>$append0</string>
<string>f</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>SkinsTool_getNotAssignedFieldList</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
2007-10-22 Jerome
* Added two utility scripts SkinsTool_checkDuplicateSelectionName and SkinsTool_getNotAssignedFieldList in erp5_toolbox
2007-08-14 Yusei
* Add utility scripts to collect translation messages.
......
168
\ No newline at end of file
169
\ 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