Changeset 258 for etherws/trunk
- Timestamp:
- 10/10/13 00:49:22 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
etherws/trunk/etherws.py
r257 r258 1049 1049 cols = zip(*rows) 1050 1050 maxlen = [0] * len(cols) 1051 1052 1051 for i in xrange(len(cols)): 1053 1052 maxlen[i] = max(len(str(c)) for c in cols[i]) 1054 1055 1053 fmt = ' '.join(['%%-%ds' % maxlen[i] for i in xrange(len(cols))]) 1056 1054 fmt = ' ' + fmt 1057 1058 1055 for row in rows: 1059 1056 print(fmt % tuple(row)) … … 1163 1160 if 'error' in result: 1164 1161 return _print_error(result['error']) 1165 1166 1162 rows = [['Port', 'VLAN', 'MAC', 'Age']] 1167 1163 for r in result['result']['entries']:
Note: See TracChangeset
for help on using the changeset viewer.