Back to index

python-cliapp  1.20120630
Private Member Functions
cliapp.settings.FormatHelpParagraphs Class Reference

List of all members.

Private Member Functions

def _format_text

Detailed Description

Definition at line 195 of file settings.py.


Member Function Documentation

def cliapp.settings.FormatHelpParagraphs._format_text (   self,
  text 
) [private]
Like the default, except handle paragraphs.

Definition at line 197 of file settings.py.

00197 
00198     def _format_text(self, text): # pragma: no cover
00199         '''Like the default, except handle paragraphs.'''
00200         
00201         def format_para(lines):
00202             para = '\n'.join(lines)
00203             return optparse.IndentedHelpFormatter._format_text(self,  para)
00204         
00205         paras = []
00206         cur = []
00207         for line in text.splitlines():
00208             if line.strip():
00209                 cur.append(line)
00210             elif cur:
00211                 paras.append(format_para(cur))
00212                 cur = []
00213         if cur:
00214             paras.append(format_para(cur))
00215         return '\n\n'.join(paras)
00216 


The documentation for this class was generated from the following file: