Experiment with auto-documentation

This commit is contained in:
Vincent Jacques
2012-02-26 11:21:02 +00:00
parent 787e1a960e
commit 3ff2ba631d
7 changed files with 92 additions and 0 deletions
@@ -19,3 +19,18 @@ class ArgumentsChecker:
if argumentName not in data:
raise TypeError()
return data
def documentParameters( self ):
mandatory = ", ".join( self.__mandatoryParameters )
optional = "[" + ", ".join( self.__optionalParameters ) + "]"
if len( self.__mandatoryParameters ) == 0:
if len( self.__optionalParameters ) == 0:
return ""
else:
return " " + optional + " "
else:
if len( self.__optionalParameters ) == 0:
return " " + mandatory + " "
else:
return " " + mandatory + ", " + optional + " "