<s> """<STR_LIT>""" <EOL> __docformat__ = '<STR_LIT>' <EOL> from epydoc . markup import * <EOL> from epydoc . util import plaintext_to_html , plaintext_to_latex <EOL> def parse_docstring ( docstring , errors , ** options ) : <EOL> """<STR_LIT>""" <EOL> return ParsedPlaintextDocstring ( docstring , ** options ) <EOL> class ParsedPlaintextDocstring ( ParsedDocstring ) : <EOL> def __init__ ( self , text , ** options ) : <EOL> self . _verbatim = options . get ( '<STR_LIT>' , <NUM_LIT:1> ) <EOL> if text is None : raise ValueError , '<STR_LIT>' <EOL> self . _text = text <EOL> def to_html ( self , docstring_linker , ** options ) : <EOL> if options . get ( '<STR_LIT>' , self . _verbatim ) == <NUM_LIT:0> : <EOL> return plaintext_to_html ( self . to_plaintext ( docstring_linker ) ) <EOL> else : <EOL> return ParsedDocstring . to_html ( self , docstring_linker , ** options ) <EOL> def to_latex ( self , docstring_linker , ** options ) : <EOL> if options . get ( '<STR_LIT>' , self . _verbatim ) == <NUM_LIT:0> : <EOL> return plaintext_to_latex ( self . to_plaintext ( docstring_linker ) ) <EOL> else : <EOL> return ParsedDocstring . to_latex ( self , docstring_linker , ** options ) <EOL> def to_plaintext ( self , docstring_linker , ** options ) : <EOL> if '<STR_LIT>' in options : <EOL> indent = options [ '<STR_LIT>' ] <EOL> lines = self . _text . split ( '<STR_LIT:\n>' ) <EOL> return '<STR_LIT:\n>' . join ( [ '<STR_LIT:U+0020>' * indent + l for l in lines ] ) + '<STR_LIT:\n>' <EOL> return self . _text + '<STR_LIT:\n>' <EOL> def summary ( self ) : <EOL> m = re . match ( r'<STR_LIT>' , self . _text ) <EOL> if m : <EOL> other = self . _text [ m . end ( ) : ] <EOL> return ( ParsedPlaintextDocstring ( m . group ( <NUM_LIT:1> ) , verbatim = <NUM_LIT:0> ) , <EOL> other != '<STR_LIT>' and not other . isspace ( ) ) <EOL> else : <EOL> parts = self . _text . strip ( '<STR_LIT:\n>' ) . split ( '<STR_LIT:\n>' , <NUM_LIT:1> ) <EOL> if len ( parts ) == <NUM_LIT:1> : <EOL> summary = parts [ <NUM_LIT:0> ] <EOL> other = False <EOL> else : <EOL> summary = parts [ <NUM_LIT:0> ] + '<STR_LIT>' <EOL> other = True <EOL> return ParsedPlaintextDocstring ( summary , verbatim = <NUM_LIT:0> ) , other </s>
