[Erp5-report] r24078 - /erp5/trunk/products/ERP5Type/DocumentationHelper/

nobody at svn.erp5.org nobody at svn.erp5.org
Tue Oct 7 18:44:44 CEST 2008


Author: mayoro
Date: Tue Oct  7 18:44:43 2008
New Revision: 24078

URL: http://svn.erp5.org?rev=24078&view=rev
Log:
Do not add empty section in getSectionList of documentations

Modified:
    erp5/trunk/products/ERP5Type/DocumentationHelper/BusinessTemplateDocumentationHelper.py
    erp5/trunk/products/ERP5Type/DocumentationHelper/DCWorkflowDocumentationHelper.py
    erp5/trunk/products/ERP5Type/DocumentationHelper/PortalTypeDocumentationHelper.py
    erp5/trunk/products/ERP5Type/DocumentationHelper/PortalTypeInstanceDocumentationHelper.py
    erp5/trunk/products/ERP5Type/DocumentationHelper/SkinFolderDocumentationHelper.py

Modified: erp5/trunk/products/ERP5Type/DocumentationHelper/BusinessTemplateDocumentationHelper.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/DocumentationHelper/BusinessTemplateDocumentationHelper.py?rev=24078&r1=24077&r2=24078&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/DocumentationHelper/BusinessTemplateDocumentationHelper.py (original)
+++ erp5/trunk/products/ERP5Type/DocumentationHelper/BusinessTemplateDocumentationHelper.py Tue Oct  7 18:44:43 2008
@@ -63,50 +63,71 @@
     """
     Returns a list of documentation sections
     """
-    return map(lambda x: x.__of__(self), [
-      DocumentationSection(
-        id='portal_type',
-        title='Portal Types',
-        class_name='PortalTypeDocumentationHelper',
-        uri_list=self.getPortalTypeURIList(),
-      ),
-      DocumentationSection(
-        id='dc_workflow',
-        title='DC Workflows',
-        class_name='DCWorkflowDocumentationHelper',
-        uri_list=self.getDCWorkflowURIList(),
-      ),
-      DocumentationSection(
-        id='interaction_workflow',
-        title='Interaction Workflows',
-        class_name='InteractionWorkflowDocumentationHelper',
-        uri_list=self.getInteractionWorkflowURIList(),
-      ),
-      DocumentationSection(
-        id='skin_folder',
-        title='Skin Folders',
-        class_name='SkinFolderDocumentationHelper',
-        uri_list=self.getSkinFolderURIList(),
-      ),
-      DocumentationSection(
-        id='module',
-        title='Module',
-        class_name='PortalTypeInstanceDocumentationHelper',
-        uri_list=self.getModuleURIList(),
-      ),
-      DocumentationSection(
-        id='catalog_method',
-        title='Catalog Method',
-        class_name='CatalogMethodDocumentationHelper',
-        uri_list=self.getCatalogMethodURIList(),
-      ),
-      DocumentationSection(
-        id='base_category',
-        title='Base Category',
-        class_name='BaseCategoryDocumentationHelper',
-        uri_list=self.getBaseCategoryURIList(),
-      ),
-    ])
+    section_list = []
+    if self.getPortalTypeURIList() != []:
+      section_list.append(
+        DocumentationSection(
+          id='portal_type',
+          title='Portal Types',
+          class_name='PortalTypeDocumentationHelper',
+          uri_list=self.getPortalTypeURIList(),
+        )
+      )
+    if self.getDCWorkflowURIList() != []:
+      section_list.append(
+        DocumentationSection(
+          id='dc_workflow',
+          title='DC Workflows',
+          class_name='DCWorkflowDocumentationHelper',
+          uri_list=self.getDCWorkflowURIList(),
+        )
+      )
+    if self.getInteractionWorkflowURIList() != []:
+      section_list.append(
+        DocumentationSection(
+          id='interaction_workflow',
+          title='Interaction Workflows',
+          class_name='InteractionWorkflowDocumentationHelper',
+          uri_list=self.getInteractionWorkflowURIList(),
+        )
+      )
+    if self.getSkinFolderURIList() != []:
+      section_list.append(
+        DocumentationSection(
+          id='skin_folder',
+          title='Skin Folders',
+          class_name='SkinFolderDocumentationHelper',
+          uri_list=self.getSkinFolderURIList(),
+        )
+      )
+    if self.getModuleURIList() != []:
+      section_list.append(
+        DocumentationSection(
+          id='module',
+          title='Module',
+          class_name='PortalTypeInstanceDocumentationHelper',
+          uri_list=self.getModuleURIList(),
+        )
+      )
+    if self.getCatalogMethodURIList() != []:
+      section_list.append( 
+        DocumentationSection(
+          id='catalog_method',
+          title='Catalog Method',
+          class_name='CatalogMethodDocumentationHelper',
+          uri_list=self.getCatalogMethodURIList(),
+        )
+      )
+    if self.getBaseCategoryURIList() != []:
+      section_list.append(
+        DocumentationSection(
+          id='base_category',
+          title='Base Category',
+          class_name='BaseCategoryDocumentationHelper',
+          uri_list=self.getBaseCategoryURIList(),
+        )
+      )
+    return map(lambda x: x.__of__(self), section_list)
 
   # Specific methods
   security.declareProtected( Permissions.AccessContentsInformation, 'getDescription' )

Modified: erp5/trunk/products/ERP5Type/DocumentationHelper/DCWorkflowDocumentationHelper.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/DocumentationHelper/DCWorkflowDocumentationHelper.py?rev=24078&r1=24077&r2=24078&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/DocumentationHelper/DCWorkflowDocumentationHelper.py (original)
+++ erp5/trunk/products/ERP5Type/DocumentationHelper/DCWorkflowDocumentationHelper.py Tue Oct  7 18:44:43 2008
@@ -105,44 +105,62 @@
     """
     Returns a list of documentation sections
     """
-    return map(lambda x: x.__of__(self), [
-      DocumentationSection(
-        id='state',
-        title='Workflow States',
-        class_name='DCWorkflowStateDocumentationHelper',
-        uri_list=self.getStateUriList(),
-      ),
-      DocumentationSection(
-        id='transition',
-        title='Workflow Transitions',
-        class_name='DCWorkflowTransitionDocumentationHelper',
-        uri_list=self.getTransitionUriList(),
-      ),
-      DocumentationSection(
-        id='variable',
-        title='Workflow Variables',
-        class_name='DCWorkflowVariableDocumentationHelper',
-        uri_list=self.getVariableUriList(),
-      ),
-      DocumentationSection(
-        id='permission',
-        title='Workflow Permissions',
-        class_name='DCWorkflowPermissionDocumentationHelper',
-        uri_list=self.getPermissionUriList(),
-      ),
-      DocumentationSection(
-        id='worklist',
-        title='Workflow Worklists',
-        class_name='DCWorkflowWorklistDocumentationHelper',
-        uri_list=self.getWorklistUriList(),
-      ),
-      DocumentationSection(
-        id='script',
-        title='Workflow Scripts',
-        class_name='DCWorkflowScriptDocumentationHelper',
-        uri_list=self.getScriptUriList(),
-      ),
-    ])
+    section_list = []
+    if self.getStateUriList() != []:
+      section_list.append(
+        DocumentationSection(
+          id='state',
+          title='Workflow States',
+          class_name='DCWorkflowStateDocumentationHelper',
+          uri_list=self.getStateUriList(),
+        )
+      )
+    if self.getTransitionUriList() != []:
+      section_list.append(
+        DocumentationSection(
+          id='transition',
+          title='Workflow Transitions',
+          class_name='DCWorkflowTransitionDocumentationHelper',
+          uri_list=self.getTransitionUriList(),
+        )
+      )
+    if self.getVariableUriList() != []: 
+      section_list.append(
+        DocumentationSection(
+          id='variable',
+          title='Workflow Variables',
+          class_name='DCWorkflowVariableDocumentationHelper',
+          uri_list=self.getVariableUriList(),
+        )
+      )
+    if self.getPermissionUriList() != []:
+      section_list.append(
+        DocumentationSection(
+          id='permission',
+          title='Workflow Permissions',
+          class_name='DCWorkflowPermissionDocumentationHelper',
+          uri_list=self.getPermissionUriList(),
+        )
+      )
+    if self.getWorklistUriList() != []:
+      section_list.append(
+        DocumentationSection(
+          id='worklist',
+          title='Workflow Worklists',
+          class_name='DCWorkflowWorklistDocumentationHelper',
+          uri_list=self.getWorklistUriList(),
+        )
+      )
+    if self.getScriptUriList() != []:  
+      section_list.append(
+        DocumentationSection(
+          id='script',
+          title='Workflow Scripts',
+          class_name='DCWorkflowScriptDocumentationHelper',
+          uri_list=self.getScriptUriList(),
+        )
+      )
+    return map(lambda x: x.__of__(self), section_list)
 
   # Specific methods
   security.declareProtected( Permissions.AccessContentsInformation, 'getStateIdList' )

Modified: erp5/trunk/products/ERP5Type/DocumentationHelper/PortalTypeDocumentationHelper.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/DocumentationHelper/PortalTypeDocumentationHelper.py?rev=24078&r1=24077&r2=24078&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/DocumentationHelper/PortalTypeDocumentationHelper.py (original)
+++ erp5/trunk/products/ERP5Type/DocumentationHelper/PortalTypeDocumentationHelper.py Tue Oct  7 18:44:43 2008
@@ -97,56 +97,89 @@
     """
     Returns a list of documentation sections
     """
-    return map(lambda x: x.__of__(self), [
-      DocumentationSection(
-        id='action',
-        title='Actions',
-        class_name='PortalTypeActionDocumentationHelper',
-        uri_list=self.getActionUriList(),
-      ),
-      DocumentationSection(
-        id='role',
-        title='Role Definitions',
-        class_name='PortalTypeRoleDocumentationHelper',
-        uri_list=self.getRoleUriList(),
-      ),
-      DocumentationSection(
-        id='allowed_content_type',
-        title='Allowed Content Type',
-        class_name='PortalTypeDocumentationHelper',
-        uri_list=self.getAllowedContentTypeURIList(),
-      ),
-      DocumentationSection(
-        id='hidden_content_type',
-        title='Hidden Content Type',
-        class_name='PortalTypeDocumentationHelper',
-        uri_list=self.getHiddenContentTypeURIList(),
-      ),
-      DocumentationSection(
-        id='property_sheet',
-        title='Property Sheet',
-        class_name='PortalTypePropertySheetDocumentationHelper',
-        uri_list=self.getPropertySheetURIList(),
-      ),
-      DocumentationSection(
-        id='workflow_method',
-        title='Workflow Method',
-        class_name='WorkflowMethodDocumentationHelper',
-        uri_list=self.getWorkflowMethodUriList(inherited=0),
-      ),
-      DocumentationSection(
-        id='accessor',
-        title='Accessor',
-        class_name='AccessorMethodDocumentationHelper',
-        uri_list=self.getAccessorMethodUriList(inherited=0),
-      ),
-      DocumentationSection(
-        id='class_method',
-        title='Class Methods',
-        class_name='ClassMethodDocumentationHelper',
-        uri_list=self.getClassMethodURIList(inherited=0),
-      ),
-    ])
+    section_list = []
+    if self.getActionUriList() != []:
+      section_list.append(
+        DocumentationSection(
+          id='action',
+          title='Actions',
+          class_name='PortalTypeActionDocumentationHelper',
+          uri_list=self.getActionUriList(),
+        )
+      )
+    if self.getRoleUriList() != []:
+      section_list.append(
+        DocumentationSection(
+          id='role',
+          title='Role Definitions',
+          class_name='PortalTypeRoleDocumentationHelper',
+          uri_list=self.getRoleUriList(),
+        )
+      )
+    if self.getRoleUriList() != []:
+      section_list.append(
+        DocumentationSection(
+          id='role',
+          title='Role Definitions',
+          class_name='PortalTypeRoleDocumentationHelper',
+          uri_list=self.getRoleUriList(),
+        )
+      )
+    if self.getAllowedContentTypeURIList() != []:
+      section_list.append(
+        DocumentationSection(
+          id='allowed_content_type',
+          title='Allowed Content Type',
+          class_name='PortalTypeDocumentationHelper',
+          uri_list=self.getAllowedContentTypeURIList(),
+        )
+      )
+    if self.getHiddenContentTypeURIList() != []:
+      section_list.append(
+        DocumentationSection(
+          id='hidden_content_type',
+          title='Hidden Content Type',
+          class_name='PortalTypeDocumentationHelper',
+          uri_list=self.getHiddenContentTypeURIList(),
+        )
+      )
+    if self.getPropertySheetURIList() != []:
+      section_list.append(
+        DocumentationSection(
+          id='property_sheet',
+          title='Property Sheet',
+          class_name='PortalTypePropertySheetDocumentationHelper',
+          uri_list=self.getPropertySheetURIList(),
+        )
+      )
+    if self.getWorkflowMethodUriList(inherited=0) != []:
+      section_list.append(
+        DocumentationSection(
+          id='workflow_method',
+          title='Workflow Method',
+          class_name='WorkflowMethodDocumentationHelper',
+          uri_list=self.getWorkflowMethodUriList(inherited=0),
+        )
+      )
+    if self.getAccessorMethodUriList(inherited=0) != []:
+      section_list.append(
+        DocumentationSection(
+          id='accessor',
+          title='Accessor',
+          class_name='AccessorMethodDocumentationHelper',
+          uri_list=self.getAccessorMethodUriList(inherited=0),
+        )
+      )
+    if self.getClassMethodURIList(inherited=0) != []:
+      section_list.append(
+        DocumentationSection(
+          id='class_method',
+          title='Class Methods',
+          class_name='ClassMethodDocumentationHelper',
+          uri_list=self.getClassMethodURIList(inherited=0),
+        )
+      )
+    return map(lambda x: x.__of__(self), section_list)
 
   # Specific methods
   security.declareProtected( Permissions.AccessContentsInformation, 'getDescription' )

Modified: erp5/trunk/products/ERP5Type/DocumentationHelper/PortalTypeInstanceDocumentationHelper.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/DocumentationHelper/PortalTypeInstanceDocumentationHelper.py?rev=24078&r1=24077&r2=24078&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/DocumentationHelper/PortalTypeInstanceDocumentationHelper.py (original)
+++ erp5/trunk/products/ERP5Type/DocumentationHelper/PortalTypeInstanceDocumentationHelper.py Tue Oct  7 18:44:43 2008
@@ -68,26 +68,35 @@
     """
     Returns a list of documentation sections
     """
-    return [
-      DocumentationSection(
-        id='workflow_method',
-        title='Workflow Method',
-        class_name='WorkflowMethodDocumentationHelper',
-        uri_list=self.getWorkflowMethodURIList(inherited=0),
-      ),
-      DocumentationSection(
-        id='accessor',
-        title='Accessor',
-        class_name='AccessorMethodDocumentationHelper',
-        uri_list=self.getAccessorMethodURIList(inherited=0),
-      ),
-      DocumentationSection(
-        id='class_method',
-        title='Class Methods',
-        class_name='ClassMethodDocumentationHelper',
-        uri_list=self.getClassMethodURIList(inherited=0),
-      ).__of__(self.getInstance()),
-    ]
+    section_list = []
+    if self.getWorkflowMethodURIList(inherited=0) != []:
+      section_list.append(
+        DocumentationSection(
+          id='workflow_method',
+          title='Workflow Method',
+          class_name='WorkflowMethodDocumentationHelper',
+          uri_list=self.getWorkflowMethodURIList(inherited=0),
+        )
+      )
+    if self.getAccessorMethodURIList(inherited=0) != []:
+      section_list.append(   
+        DocumentationSection(
+          id='accessor',
+          title='Accessor',
+          class_name='AccessorMethodDocumentationHelper',
+          uri_list=self.getAccessorMethodURIList(inherited=0),
+        )
+      )
+    if self.getClassMethodURIList(inherited=0) != []:  
+      section_list.append(
+        DocumentationSection(
+          id='class_method',
+          title='Class Methods',
+          class_name='ClassMethodDocumentationHelper',
+          uri_list=self.getClassMethodURIList(inherited=0),
+        )
+      )
+    return map(lambda x: x.__of__(self.getInstance()), section_list)
 
   # Specific methods
   security.declareProtected( Permissions.AccessContentsInformation, 'getPortalType' )

Modified: erp5/trunk/products/ERP5Type/DocumentationHelper/SkinFolderDocumentationHelper.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/DocumentationHelper/SkinFolderDocumentationHelper.py?rev=24078&r1=24077&r2=24078&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/DocumentationHelper/SkinFolderDocumentationHelper.py (original)
+++ erp5/trunk/products/ERP5Type/DocumentationHelper/SkinFolderDocumentationHelper.py Tue Oct  7 18:44:43 2008
@@ -48,32 +48,44 @@
     """
     Returns a list of documentation sections
     """
-    return map(lambda x: x.__of__(self), [
-      DocumentationSection(
-        id='erp5_form',
-        title='ERP5 Form',
-        class_name='ERP5FormDocumentationHelper',
-        uri_list=self.getFileURIList(meta_type='ERP5 Form'),
-      ),
-      DocumentationSection(
-        id='zsql_method',
-        title='Z SQL Method',
-        class_name='ZSQLMethodDocumentationHelper',
-        uri_list=self.getFileURIList(meta_type='Z SQL Method'),
-      ),
-      DocumentationSection(
-        id='page_template',
-        title='Page Template',
-        class_name='PageTemplateDocumentationHelper',
-        uri_list=self.getFileURIList(meta_type='Page Template'),
-      ),
-      DocumentationSection(
-        id='script_python',
-        title='Script (Python)',
-        class_name='ScriptPythonDocumentationHelper',
-        uri_list=self.getFileURIList(meta_type='Script (Python)'),
-      ),
-    ])
+    section_list = []
+    if self.getFileURIList(meta_type='ERP5 Form') != []:
+      section_list.append(
+        DocumentationSection(
+          id='erp5_form',
+          title='ERP5 Form',
+          class_name='ERP5FormDocumentationHelper',
+          uri_list=self.getFileURIList(meta_type='ERP5 Form'),
+        )
+      )
+    if self.getFileURIList(meta_type='Z SQL Method') != []: 
+      section_list.append(
+        DocumentationSection(
+          id='zsql_method',
+          title='Z SQL Method',
+          class_name='ZSQLMethodDocumentationHelper',
+          uri_list=self.getFileURIList(meta_type='Z SQL Method'),
+        )
+      )
+    if self.getFileURIList(meta_type='Page Template') != []:  
+      section_list.append(
+        DocumentationSection(
+          id='page_template',
+          title='Page Template',
+          class_name='PageTemplateDocumentationHelper',
+          uri_list=self.getFileURIList(meta_type='Page Template'),
+        )
+      )
+    if self.getFileURIList(meta_type='Script (Python)') != []:
+      section_list.append(
+        DocumentationSection(
+          id='script_python',
+          title='Script (Python)',
+          class_name='ScriptPythonDocumentationHelper',
+          uri_list=self.getFileURIList(meta_type='Script (Python)'),
+        )
+      )
+    return map(lambda x: x.__of__(self), section_list)
 
   security.declareProtected(Permissions.AccessContentsInformation, 'getType' )
   def getType(self):




More information about the Erp5-report mailing list