Changeset 991


Ignore:
Timestamp:
Jul 6, 2012 11:14:46 AM (11 years ago)
Author:
jemian
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • specdomain/trunk/src/specdomain/sphinxcontrib/specmacrofileparser.py

    r990 r991  
    426426        return '\n'.join(s)
    427427   
    428     def old_report_table(self, title, itemlist, col_keys = ('start_line', 'line',)):
    429         """ return the itemlist as a reST table """
    430         s = []
    431         if len(itemlist) == 0:
    432             return s
    433         widths = dict([( key, len(str(key)) ) for key in col_keys])
    434         for d in itemlist:
    435             widths = dict([( key, max(w, len(str(d[key])))) for key, w in widths.items()])
    436         separator = " ".join( ["="*widths[key] for key in col_keys] )
    437         fmt = " ".join( ["%%-%ds"%widths[key] for key in col_keys] )
    438         s.append( '' )
    439         s.append( title )
    440         s.append( '='*len(title) )
    441         s.append( '' )
    442         s.append( separator )
    443         s.append( fmt % tuple([str(key.strip()) for key in col_keys]) )
    444         s.append( separator )
    445         last_line = -1
    446         for d in itemlist:
    447             if d['start_line'] != last_line:
    448                 s.append( fmt % tuple([str(d[key]).strip() for key in col_keys]) )
    449             last_line = d['start_line']
    450         s.append( separator )
    451         return s
    452    
    453428    def _report_table(self, title, itemlist, col_keys = ('start_line', 'line',)):
    454429        """ return the itemlist as a reST table """
Note: See TracChangeset for help on using the changeset viewer.