Commit c063ea95 authored by Sebastien Robin's avatar Sebastien Robin

- make the display of parameters of python script really working


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@24647 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent fedc7091
...@@ -46,11 +46,6 @@ def getDefinitionString(obj=None): ...@@ -46,11 +46,6 @@ def getDefinitionString(obj=None):
fc.append('*args') fc.append('*args')
elif fc_var_names[i] == 'kw': elif fc_var_names[i] == 'kw':
fc.append('**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: else:
fc.append(fc_var_names[i]) fc.append(fc_var_names[i])
fd = obj.func_defaults fd = obj.func_defaults
......
...@@ -64,6 +64,13 @@ class ScriptPythonDocumentationHelper(DocumentationHelper): ...@@ -64,6 +64,13 @@ class ScriptPythonDocumentationHelper(DocumentationHelper):
""" """
return getattr(self.getDocumentedObject(), "title", '') 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' ) security.declareProtected( Permissions.AccessContentsInformation, 'getSourceCode' )
def getSourceCode(self): def getSourceCode(self):
""" """
...@@ -95,6 +102,6 @@ class ScriptPythonDocumentationHelper(DocumentationHelper): ...@@ -95,6 +102,6 @@ class ScriptPythonDocumentationHelper(DocumentationHelper):
""" """
Returns the definition of the script with the name of the script and arguments 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) InitializeClass(ScriptPythonDocumentationHelper)
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