def docstringLStrip(docstring):
 if (not docstring):
  return docstring
 docstring = string.replace(docstring, ' DCTB ', (' ' * 8))
 lines = string.split(docstring, '\n')
 leading = 0
 for l in xrange(1, len(lines)):
  line = lines[l]
  if string.strip(line):
   while 1:
    if (line[leading] == ' '):
     leading = (leading + 1)
    else:
     break
  if leading:
   break
 outlines = lines[0:1]
 for l in xrange(1, len(lines)):
  outlines.append(lines[l][leading:])
 return string.join(outlines, '\n')

def docstringLStrip ( docstring ) : if ( not docstring ) : return docstring docstring = string . replace ( docstring , ' DCTB ' , ( ' ' * 8 ) ) lines = string . split ( docstring , '\n' ) leading = 0 for l in xrange ( 1 , len ( lines ) ) : line = lines [ l ] if string . strip ( line ) : while 1 : if ( line [ leading ] == ' ' ) : leading = ( leading + 1 ) else : break if leading : break outlines = lines [ 0 : 1 ] for l in xrange ( 1 , len ( lines ) ) : outlines . append ( lines [ l ] [ leading : ] ) return string . join ( outlines , '\n' )
gets rid of unsightly lefthand docstring whitespace residue .