comparison roundup/cgi/form_parser.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 a412ce8ccf6f
children 693c75d56ebe
comparison
equal deleted inserted replaced
4268:b78eb8fc821a 4269:ab4563e97d22
425 if entry not in existing: 425 if entry not in existing:
426 existing.append(entry) 426 existing.append(entry)
427 value = existing 427 value = existing
428 # Sort the value in the same order used by 428 # Sort the value in the same order used by
429 # Multilink.from_raw. 429 # Multilink.from_raw.
430 value.sort(key = lambda x: int(x)) 430 value.sort(lambda x, y: cmp(int(x),int(y)))
431 431
432 elif value == '': 432 elif value == '':
433 # other types should be None'd if there's no value 433 # other types should be None'd if there's no value
434 value = None 434 value = None
435 else: 435 else:
489 # be sure to use the same sort order in all places, 489 # be sure to use the same sort order in all places,
490 # since we want to compare values with "=" or "!=". 490 # since we want to compare values with "=" or "!=".
491 # The canonical order (given in Multilink.from_raw) is 491 # The canonical order (given in Multilink.from_raw) is
492 # by the numeric value of the IDs. 492 # by the numeric value of the IDs.
493 if isinstance(proptype, hyperdb.Multilink): 493 if isinstance(proptype, hyperdb.Multilink):
494 existing.sort(key = lambda x: int(x)) 494 existing.sort(lambda x, y: cmp(int(x),int(y)))
495 495
496 # "missing" existing values may not be None 496 # "missing" existing values may not be None
497 if not existing: 497 if not existing:
498 if isinstance(proptype, hyperdb.String): 498 if isinstance(proptype, hyperdb.String):
499 # some backends store "missing" Strings as empty strings 499 # some backends store "missing" Strings as empty strings

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