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

nobody at svn.erp5.org nobody at svn.erp5.org
Thu Nov 20 10:44:50 CET 2008


Author: seb
Date: Thu Nov 20 10:44:49 2008
New Revision: 24647

URL: http://svn.erp5.org?rev=24647&view=rev
Log:
- make the display of parameters of python script really working

Modified:
    erp5/trunk/products/ERP5Type/DocumentationHelper/AccessorMethodDocumentationHelper.py
    erp5/trunk/products/ERP5Type/DocumentationHelper/ScriptPythonDocumentationHelper.py

Modified: erp5/trunk/products/ERP5Type/DocumentationHelper/AccessorMethodDocumentationHelper.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/DocumentationHelper/AccessorMethodDocumentationHelper.py?rev=24647&r1=24646&r2=24647&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/DocumentationHelper/AccessorMethodDocumentationHelper.py [utf8] (original)
+++ erp5/trunk/products/ERP5Type/DocumentationHelper/AccessorMethodDocumentationHelper.py [utf8] Thu Nov 20 10:44:49 2008
@@ -46,11 +46,6 @@
       fc.append('*args')
     elif fc_var_names[i] == 'kw':
       fc.append('**kw')
-    elif fc_var_names[i].startswith('_') or \
-        fc_var_names[i].startswith('Products'):
-      # In case of python scripts, we have many things
-      # that we do not want to display
-      break
     else:
       fc.append(fc_var_names[i])
   fd = obj.func_defaults

Modified: erp5/trunk/products/ERP5Type/DocumentationHelper/ScriptPythonDocumentationHelper.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/DocumentationHelper/ScriptPythonDocumentationHelper.py?rev=24647&r1=24646&r2=24647&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/DocumentationHelper/ScriptPythonDocumentationHelper.py [utf8] (original)
+++ erp5/trunk/products/ERP5Type/DocumentationHelper/ScriptPythonDocumentationHelper.py [utf8] Thu Nov 20 10:44:49 2008
@@ -64,6 +64,13 @@
     """
     return getattr(self.getDocumentedObject(), "title", '')
 
+  security.declareProtected(Permissions.AccessContentsInformation, 'getParams' )
+  def getParams(self):
+    """
+    Returns the title of the documentation helper
+    """
+    return getattr(self.getDocumentedObject(), "_params", '')
+
   security.declareProtected( Permissions.AccessContentsInformation, 'getSourceCode' )
   def getSourceCode(self):
     """
@@ -95,6 +102,6 @@
     """
     Returns the definition of the script with the name of the script and arguments
     """
-    return getDefinitionString(self.getDocumentedObject())
+    return "%s(%s)" % (self.getId(), self.getParams())
 
 InitializeClass(ScriptPythonDocumentationHelper)




More information about the Erp5-report mailing list