Changeset 435
- Timestamp:
- 05/24/07 04:33:56 (2 years ago)
- Files:
-
- cly/trunk/cly/console.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
cly/trunk/cly/console.py
r434 r435 436 436 raise Exception, 'Table exceeds maximum width' 437 437 438 # Scale columns out to max_width 438 439 if expand_to_fit is True or max_width < sum(colwidths): 439 440 scale = float(max_width - 1 - sum(min_widths)) / float(sum(colwidths) - sum(min_widths)) 440 441 colwidths = [max(int(float(colwidths[x]) * scale), min_widths[x]) for x in range(0, len(colwidths))] 441 442 mincol = min(colwidths) 442 for i, col in enumerate(colwidths): 443 if col == mincol: 444 colwidths[0] += max_width - sum(colwidths) 443 # Pad smallest column out so total width is size of max_width 444 colwidths[colwidths.index(mincol)] += max_width - sum(colwidths) 445 445 446 446 auto_format = list(auto_format)
