Exemple #1
0
 def _find_signature(self, encoding=None):
     docstrings = Documenter.get_doc(self, encoding, 2)
     if len(docstrings) != 1:
         return
     doclines = docstrings[0]
     setattr(self, '__new_doclines', doclines)
     if not doclines:
         return
     # match first line of docstring against signature RE
     match = yaml_sig_re.match(doclines[0])
     if not match:
         return
     name = match.group(1)
     # ok, now jump over remaining empty lines and set the remaining
     # lines as the new doclines
     i = 1
     while i < len(doclines) and not doclines[i].strip():
         i += 1
     setattr(self, '__new_doclines', doclines[i:])
     return name
Exemple #2
0
 def _find_signature(self, encoding=None):
     docstrings = Documenter.get_doc(self, encoding, 2)
     if len(docstrings) != 1:
         return
     doclines = docstrings[0]
     setattr(self, '__new_doclines', doclines)
     if not doclines:
         return
     # match first line of docstring against signature RE
     match = yaml_sig_re.match(doclines[0])
     if not match:
         return
     name = match.group(1)
     # ok, now jump over remaining empty lines and set the remaining
     # lines as the new doclines
     i = 1
     while i < len(doclines) and not doclines[i].strip():
         i += 1
     setattr(self, '__new_doclines', doclines[i:])
     return name
Exemple #3
0
 def get_doc(self, encoding=None, ignore=1):
     lines = getattr(self, '__new_doclines', None)
     if lines is not None:
         return [lines]
     return Documenter.get_doc(self, encoding, ignore)
Exemple #4
0
 def get_doc(self, encoding=None, ignore=1):
     lines = getattr(self, '__new_doclines', None)
     if lines is not None:
         return [lines]
     return Documenter.get_doc(self, encoding, ignore)