comparison roundup/admin.py @ 1546:ab2aa490d713

bugfix
author Richard Jones <richard@users.sourceforge.net>
date Sun, 23 Mar 2003 09:37:20 +0000
parents 6db2cbcd390e
children e2a8ce4d2317
comparison
equal deleted inserted replaced
1545:838997c8c94e 1546:ab2aa490d713
14 # BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 14 # BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
15 # FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS" 15 # FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS"
16 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, 16 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
17 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. 17 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
18 # 18 #
19 # $Id: admin.py,v 1.46 2003-03-23 06:07:05 richard Exp $ 19 # $Id: admin.py,v 1.47 2003-03-23 09:37:20 richard Exp $
20 20
21 '''Administration commands for maintaining Roundup trackers. 21 '''Administration commands for maintaining Roundup trackers.
22 ''' 22 '''
23 23
24 import sys, os, getpass, getopt, re, UserDict, shlex, shutil 24 import sys, os, getpass, getopt, re, UserDict, shlex, shutil
799 # now figure column widths 799 # now figure column widths
800 props = [] 800 props = []
801 for spec in prop_names: 801 for spec in prop_names:
802 if ':' in spec: 802 if ':' in spec:
803 name, width = spec.split(':') 803 name, width = spec.split(':')
804 if width == '': 804 if width == '':
805 props.append((name, len(spec))) 805 props.append((name, len(spec)))
806 else: 806 else:
807 props.append((name, int(width))) 807 props.append((name, int(width)))
808 else: 808 else:
809 # this is going to be slow 809 # this is going to be slow
810 maxlen = len(spec) 810 maxlen = len(spec)
811 for nodeid in cl.list(): 811 for nodeid in cl.list():
812 curlen = len(str(cl.get(nodeid, spec))) 812 curlen = len(str(cl.get(nodeid, spec)))
813 if curlen > maxlen: 813 if curlen > maxlen:
814 maxlen = curlen 814 maxlen = curlen
815 props.append((spec, maxlen)) 815 props.append((spec, maxlen))
816 816
817 # now display the heading 817 # now display the heading
818 print ' '.join([name.capitalize().ljust(width) for name,width in props]) 818 print ' '.join([name.capitalize().ljust(width) for name,width in props])
819 819
820 # and the table data 820 # and the table data

Roundup Issue Tracker: http://roundup-tracker.org/