summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 53d265b)
raw | patch | inline | side by side (parent: 53d265b)
author | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Sun, 23 Mar 2003 06:07:05 +0000 (06:07 +0000) | ||
committer | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Sun, 23 Mar 2003 06:07:05 +0000 (06:07 +0000) |
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@1616 57a73879-2fb5-44c3-a270-3262357dd7e2
CHANGES.txt | patch | blob | history | |
roundup/admin.py | patch | blob | history |
diff --git a/CHANGES.txt b/CHANGES.txt
index e91d50932f76a6742e9657f7355d0d40cf2750ba..3efa6645c324a6df924781de691a3b618f446fd5 100644 (file)
--- a/CHANGES.txt
+++ b/CHANGES.txt
- added example HTML tempating for vacation flag (sf bug 701722)
- only look for CSV files when importing (thanks Dan Grassi)
- can now unset values in CSV editing (sf bug 704788)
+- finally, tables autosize columns (sf bug 609070)
2003-??-?? 0.5.7
diff --git a/roundup/admin.py b/roundup/admin.py
index 4521c812578f6c69cc7538f0a4f65ed0f5227578..81004946b286b418d4e2887c6aac1153ff6501be 100644 (file)
--- a/roundup/admin.py
+++ b/roundup/admin.py
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
#
-# $Id: admin.py,v 1.45 2003-03-21 04:02:12 richard Exp $
+# $Id: admin.py,v 1.46 2003-03-23 06:07:05 richard Exp $
'''Administration commands for maintaining Roundup trackers.
'''
if arg.find('=') == -1:
raise UsageError, _('argument "%(arg)s" not propname=value'
)%locals()
- try:
- key, value = arg.split('=')
- except ValueError:
+ l = arg.split('=')
+ if len(l) < 2:
raise UsageError, _('argument "%(arg)s" not propname=value'
)%locals()
+ key, value = l[0], '='.join(l[1:])
if value:
props[key] = value
else:
Lists all instances of the given class. If the properties are not
specified, all properties are displayed. By default, the column widths
- are the width of the property names. The width may be explicitly defined
+ are the width of the largest value. The width may be explicitly defined
by defining the property as "name:width". For example::
roundup> table priority id,name:10
Id Name
2 bug
3 usability
4 feature
+
+ Also to make the width of the column the width of the label,
+ leave a trailing : without a width on the property. E.G.
+ roundup> table priority id,name:
+ Id Name
+ 1 fata
+ 2 bug
+ 3 usab
+ 4 feat
+
+ will result in a the 4 character wide "Name" column.
'''
if len(args) < 1:
raise UsageError, _('Not enough arguments supplied')
for spec in prop_names:
if ':' in spec:
name, width = spec.split(':')
- props.append((name, int(width)))
+ if width == '':
+ props.append((name, len(spec)))
+ else:
+ props.append((name, int(width)))
else:
- props.append((spec, len(spec)))
-
+ # this is going to be slow
+ maxlen = len(spec)
+ for nodeid in cl.list():
+ curlen = len(str(cl.get(nodeid, spec)))
+ if curlen > maxlen:
+ maxlen = curlen
+ props.append((spec, maxlen))
+
# now display the heading
print ' '.join([name.capitalize().ljust(width) for name,width in props])