[Erp5-report] r17081 - in /erp5/trunk/bt5/erp5_forge: SkinTemplateItem/portal_skins/erp5_to...
nobody at svn.erp5.org
nobody at svn.erp5.org
Mon Oct 22 11:31:47 CEST 2007
Author: jerome
Date: Mon Oct 22 11:31:47 2007
New Revision: 17081
URL: http://svn.erp5.org?rev=17081&view=rev
Log:
2007-10-22 Jerome
* Added two utility scripts SkinsTool_checkDuplicateSelectionName and SkinsTool_getNotAssignedFieldList in erp5_toolbox
Added:
erp5/trunk/bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_toolbox/SkinsTool_checkDuplicateSelectionName.xml
erp5/trunk/bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_toolbox/SkinsTool_getNotAssignedFieldList.xml
erp5/trunk/bt5/erp5_forge/bt/template_tool_id_list
Modified:
erp5/trunk/bt5/erp5_forge/bt/change_log
erp5/trunk/bt5/erp5_forge/bt/revision
Added: erp5/trunk/bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_toolbox/SkinsTool_checkDuplicateSelectionName.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_toolbox/SkinsTool_checkDuplicateSelectionName.xml?rev=17081&view=auto
==============================================================================
--- erp5/trunk/bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_toolbox/SkinsTool_checkDuplicateSelectionName.xml (added)
+++ erp5/trunk/bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_toolbox/SkinsTool_checkDuplicateSelectionName.xml Mon Oct 22 11:31:47 2007
@@ -1,0 +1,180 @@
+<?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>
Added: erp5/trunk/bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_toolbox/SkinsTool_getNotAssignedFieldList.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_toolbox/SkinsTool_getNotAssignedFieldList.xml?rev=17081&view=auto
==============================================================================
--- erp5/trunk/bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_toolbox/SkinsTool_getNotAssignedFieldList.xml (added)
+++ erp5/trunk/bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_toolbox/SkinsTool_getNotAssignedFieldList.xml Mon Oct 22 11:31:47 2007
@@ -1,0 +1,171 @@
+<?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>
Modified: erp5/trunk/bt5/erp5_forge/bt/change_log
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_forge/bt/change_log?rev=17081&r1=17080&r2=17081&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_forge/bt/change_log (original)
+++ erp5/trunk/bt5/erp5_forge/bt/change_log Mon Oct 22 11:31:47 2007
@@ -1,3 +1,6 @@
+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.
Modified: erp5/trunk/bt5/erp5_forge/bt/revision
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_forge/bt/revision?rev=17081&r1=17080&r2=17081&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_forge/bt/revision (original)
+++ erp5/trunk/bt5/erp5_forge/bt/revision Mon Oct 22 11:31:47 2007
@@ -1,1 +1,1 @@
-168
+169
Added: erp5/trunk/bt5/erp5_forge/bt/template_tool_id_list
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_forge/bt/template_tool_id_list?rev=17081&view=auto
==============================================================================
(empty)
More information about the Erp5-report
mailing list