Revision ec39d63c
b/lib/cli.py | ||
---|---|---|
1575 | 1575 |
for idx, name in enumerate(fields): |
1576 | 1576 |
hdr = headers[name] |
1577 | 1577 |
if separator is None: |
1578 |
if idx == len(fields) - 1 and not numfields.Matches(name): |
|
1579 |
mlens[idx] = 0 |
|
1580 |
else: |
|
1581 |
mlens[idx] = max(mlens[idx], len(hdr)) |
|
1578 |
mlens[idx] = max(mlens[idx], len(hdr)) |
|
1582 | 1579 |
args.append(mlens[idx]) |
1583 | 1580 |
args.append(hdr) |
1584 | 1581 |
result.append(format % tuple(args)) |
1585 | 1582 |
|
1583 |
if separator is None: |
|
1584 |
assert len(mlens) == len(fields) |
|
1585 |
|
|
1586 |
if fields and not numfields.Matches(fields[-1]): |
|
1587 |
mlens[-1] = 0 |
|
1588 |
|
|
1586 | 1589 |
for line in data: |
1587 | 1590 |
args = [] |
1588 | 1591 |
if line is None: |
Also available in: Unified diff