comparison roundup/admin.py @ 4269:ab4563e97d22

corrections for python2.3 compatibility: - rename testdata in test/test_anypy_hashlib.py, python2.3 testsuite will try to execute anything that starts with "test". - fix generator expressions in roundup/admin.py - fix sort calls with key attribute, use a standard (slower) compare function instead - Add 'sqlite' to ImportError exceptions when searching for backends
author Ralf Schlatterbeck <schlatterbeck@users.sourceforge.net>
date Fri, 09 Oct 2009 14:32:21 +0000
parents 88af08f8666f
children e16a1131ba67
comparison
equal deleted inserted replaced
4268:b78eb8fc821a 4269:ab4563e97d22
1124 if self.verbose: 1124 if self.verbose:
1125 sys.stdout.write('\rExporting %s - %s'%(classname, nodeid)) 1125 sys.stdout.write('\rExporting %s - %s'%(classname, nodeid))
1126 sys.stdout.flush() 1126 sys.stdout.flush()
1127 node = cl.getnode(nodeid) 1127 node = cl.getnode(nodeid)
1128 exp = cl.export_list(propnames, nodeid) 1128 exp = cl.export_list(propnames, nodeid)
1129 lensum = sum (len (repr(node[p])) for p in propnames) 1129 lensum = sum ([len (repr(node[p])) for p in propnames])
1130 # for a safe upper bound of field length we add 1130 # for a safe upper bound of field length we add
1131 # difference between CSV len and sum of all field lengths 1131 # difference between CSV len and sum of all field lengths
1132 d = sum (len(x) for x in exp) - lensum 1132 d = sum ([len(x) for x in exp]) - lensum
1133 assert (d > 0) 1133 assert (d > 0)
1134 for p in propnames: 1134 for p in propnames:
1135 ll = len(repr(node[p])) + d 1135 ll = len(repr(node[p])) + d
1136 if ll > max_len: 1136 if ll > max_len:
1137 max_len = ll 1137 max_len = ll

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