<?xml version="1.0"?>
<ZopeData>
  <record id="1" aka="AAAAAAAAAAE=">
    <pickle>
      <tuple>
        <tuple>
          <string>Products.PythonScripts.PythonScript</string>
          <string>PythonScript</string>
        </tuple>
        <none/>
      </tuple>
    </pickle>
    <pickle>
      <dictionary>
        <item>
            <key> <string>Python_magic</string> </key>
            <value> <string encoding="base64">O/INCg==</string> </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>from Products.ERP5Type.Cache import CachingMethod, clearCache\n
from ZODB.POSException import ConflictError\n
\n
user = context.portal_membership.getAuthenticatedMember().getUserName()\n
\n
portal = context.getPortalObject()\n
\n
# (BIG) HACK : we invalidate cache if we are call without filter\n
#   (ie when we are editing the PreferredVisibleModuleList)\n
if not filter : \n
  clearCache()\n
\n
## do not filter when there is no visible module selected\n
try : \n
  if len(portal.portal_preferences.getPreferredVisibleModuleList()) == 0 : \n
    filter = 0\n
except ConflictError : raise\n
except : filter = 0\n
\n
def getModuleItemList(user=None, portal_path=None, filter=filter):\n
  gettext = context.Localizer.erp5_ui.gettext\n
  item_list = []\n
  try :\n
    for module_id in portal.objectIds(\'ERP5 Folder\'):\n
      try:\n
        module = portal[module_id]\n
        url = module.getPath()\n
        label = module.getTitleOrId()\n
        label = gettext(label)\n
        if not filter or url in portal.portal_preferences.getPreferredVisibleModuleList() : \n
          item_list.append((label, url))\n
      except ConflictError : raise\n
      except: pass\n
  except ConflictError : raise\n
  except: pass\n
\n
  def compareModules(a, b): return cmp(a[0], b[0])\n
  item_list.sort(compareModules)\n
  return item_list\n
\n
getModuleItemList = CachingMethod(getModuleItemList, id=\'ERP5Site_getModuleItemList\')\n
portal_path = context.getPortalObject().getPhysicalPath()\n
return getModuleItemList(user=user, portal_path=portal_path, filter=filter)\n
</string> </value>
        </item>
        <item>
            <key> <string>_code</string> </key>
            <value>
              <none/>
            </value>
        </item>
        <item>
            <key> <string>_filepath</string> </key>
            <value> <string>Script (Python):/nexedi/portal_skins/local_erp5/ERP5Site_getModuleItemList</string> </value>
        </item>
        <item>
            <key> <string>_params</string> </key>
            <value> <string>filter=1</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>1</int> </value>
                    </item>
                    <item>
                        <key> <string>co_varnames</string> </key>
                        <value>
                          <tuple>
                            <string>filter</string>
                            <string>Products.ERP5Type.Cache</string>
                            <string>CachingMethod</string>
                            <string>clearCache</string>
                            <string>ZODB.POSException</string>
                            <string>ConflictError</string>
                            <string>_getattr_</string>
                            <string>context</string>
                            <string>user</string>
                            <string>portal</string>
                            <string>len</string>
                            <string>None</string>
                            <string>getModuleItemList</string>
                            <string>portal_path</string>
                          </tuple>
                        </value>
                    </item>
                  </dictionary>
                </state>
              </object>
            </value>
        </item>
        <item>
            <key> <string>func_defaults</string> </key>
            <value>
              <tuple>
                <int>1</int>
              </tuple>
            </value>
        </item>
        <item>
            <key> <string>id</string> </key>
            <value> <string>ERP5Site_getModuleItemList</string> </value>
        </item>
        <item>
            <key> <string>warnings</string> </key>
            <value>
              <tuple/>
            </value>
        </item>
      </dictionary>
    </pickle>
  </record>
</ZopeData>
