def _appendToDocstring(thingWithDoc, textToAppend):
 if thingWithDoc.__doc__:
  docstringLines = thingWithDoc.__doc__.splitlines()
 else:
  docstringLines = []
 if (len(docstringLines) == 0):
  docstringLines.append(textToAppend)
 elif (len(docstringLines) == 1):
  docstringLines.extend(['', textToAppend, ''])
 else:
  spaces = docstringLines.pop()
  docstringLines.extend(['', (spaces + textToAppend), spaces])
 thingWithDoc.__doc__ = '\n'.join(docstringLines)

def _appendToDocstring ( thingWithDoc , textToAppend ) : if thingWithDoc . __doc__ : docstringLines = thingWithDoc . __doc__ . splitlines ( ) else : docstringLines = [ ] if ( len ( docstringLines ) == 0 ) : docstringLines . append ( textToAppend ) elif ( len ( docstringLines ) == 1 ) : docstringLines . extend ( [ '' , textToAppend , '' ] ) else : spaces = docstringLines . pop ( ) docstringLines . extend ( [ '' , ( spaces + textToAppend ) , spaces ] ) thingWithDoc . __doc__ = '\n' . join ( docstringLines )
append the given text to the docstring of c{thingwithdoc} .