Changeset 569
- Timestamp:
- 07/12/08 10:43:00 (5 months ago)
- Files:
-
- cly/trunk/cly/console.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
cly/trunk/cly/console.py
r556 r569 471 471 Table indentation as a string. 472 472 473 ``auto_format=('^B^U', '^6', '^B^2')``: tuple 474 A tuple specifying the formatting colours to use for each row. The 475 first element is the header colour, subsequent elements are for 476 alternating rows. 473 ``header_format='^B^U'``: string 474 Formatting to use for header. 475 476 ``row_format=('^6', '^B^6')``: tuple 477 A tuple specifying cycling formatting colours to use for each row. 477 478 478 479 ``expand_to_fit=True``: boolean or integer … … 501 502 if not isinstance(min_widths, dict): 502 503 min_widths = dict(enumerate(min_widths or [])) 503 min_widths = dict([(k, v) for k, v in min_widths.items()])504 504 505 505 # Column widths … … 517 517 # Scale columns to fit 518 518 if width > term_width or expand_to_fit: 519 scale = float(term_width) / width 520 widths = [max(1, int(w * scale)) for w in widths] 519 scale = float(term_width - sum(min_widths.values())) / width 520 widths = [max(int(w * scale), min_widths.get(i, 1)) 521 for i, w in enumerate(widths)] 521 522 522 523 row_alt = -1
