Example #1
0
 def computeBody (self,s,start,sigStart,codeEnd):
     '''Return the body of a section.'''
     trace = False and not g.unitTesting
     # Never indent any text; discard the entire signature.
     body1 = ''
     body2 = s[self.sigEnd:codeEnd]
     body2 = g.removeLeadingBlankLines(body2) 
     # Don't warn about missing tail newlines: they will be added.
     if trace:
         # g.trace(s[start:sigStart])
         g.trace('body: %s' % repr(body1 + body2),'\n',g.callers())
     return body1,body2
Example #2
0
 def computeBody(self, s, start, sigStart, codeEnd):
     '''Return the body of a section.'''
     trace = False and not g.unitTesting
     # Never indent any text; discard the entire signature.
     body1 = ''
     body2 = s[self.sigEnd: codeEnd]
     body2 = g.removeLeadingBlankLines(body2)
     # Don't warn about missing tail newlines: they will be added.
     if trace:
         # g.trace(s[start:sigStart])
         g.trace('body: %s' % repr(body1 + body2), '\n', g.callers())
     return body1, body2
Example #3
0
 def computeBody(self, s, start, sigStart, codeEnd):
     '''Compute the body of an rst node.'''
     trace = False and not g.unitTesting
     body1 = s[start: sigStart]
     # Adjust start backwards to get a better undent.
     if body1.strip():
         while start > 0 and s[start - 1] in (' ', '\t'):
             start -= 1
     # Never indent any text; discard the entire signature.
     body1 = s[start: sigStart]
     body2 = s[self.sigEnd + 1: codeEnd]
     body2 = g.removeLeadingBlankLines(body2) # 2009/12/28
     body = body1 + body2
     # Don't warn about missing tail newlines: they will be added.
     if trace: g.trace('body: %s' % repr(body))
     return body1, body2
Example #4
0
 def computeBody(self, s, start, sigStart, codeEnd):
     '''Compute the body of an rst node.'''
     trace = False and not g.unitTesting
     body1 = s[start:sigStart]
     # Adjust start backwards to get a better undent.
     if body1.strip():
         while start > 0 and s[start - 1] in (' ', '\t'):
             start -= 1
     # Never indent any text; discard the entire signature.
     body1 = s[start:sigStart]
     body2 = s[self.sigEnd + 1:codeEnd]
     body2 = g.removeLeadingBlankLines(body2)  # 2009/12/28
     body = body1 + body2
     # Don't warn about missing tail newlines: they will be added.
     if trace: g.trace('body: %s' % repr(body))
     return body1, body2