comparison roundup/roundupdb.py @ 3132:3475ae520f19

code cleanup (patch [SF#115329] and additional)
author Richard Jones <richard@users.sourceforge.net>
date Sat, 12 Feb 2005 00:57:08 +0000
parents a8808157f892
children 07c696890f55
comparison
equal deleted inserted replaced
3130:7308c3c5a943 3132:3475ae520f19
13 # BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 13 # BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
14 # FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS" 14 # FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS"
15 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, 15 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
16 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. 16 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
17 # 17 #
18 # $Id: roundupdb.py,v 1.117 2004-11-12 04:07:03 richard Exp $ 18 # $Id: roundupdb.py,v 1.118 2005-02-12 00:57:08 richard Exp $
19 19
20 """Extending hyperdb with types specific to issue-tracking. 20 """Extending hyperdb with types specific to issue-tracking.
21 """ 21 """
22 __docformat__ = 'restructuredtext' 22 __docformat__ = 'restructuredtext'
23 23
431 cl = self.db.classes[cn] 431 cl = self.db.classes[cn]
432 props = cl.getprops(protected=0) 432 props = cl.getprops(protected=0)
433 433
434 # list the values 434 # list the values
435 m = [] 435 m = []
436 l = props.items() 436 prop_items = props.items()
437 l.sort() 437 prop_items.sort()
438 for propname, prop in l: 438 for propname, prop in prop_items:
439 value = cl.get(nodeid, propname, None) 439 value = cl.get(nodeid, propname, None)
440 # skip boring entries 440 # skip boring entries
441 if not value: 441 if not value:
442 continue 442 continue
443 if isinstance(prop, hyperdb.Link): 443 if isinstance(prop, hyperdb.Link):
498 except: 498 except:
499 changed[key] = new_value 499 changed[key] = new_value
500 500
501 # list the changes 501 # list the changes
502 m = [] 502 m = []
503 l = changed.items() 503 changed_items = changed.items()
504 l.sort() 504 changed_items.sort()
505 for propname, oldvalue in l: 505 for propname, oldvalue in changed_items:
506 prop = props[propname] 506 prop = props[propname]
507 value = cl.get(nodeid, propname, None) 507 value = cl.get(nodeid, propname, None)
508 if isinstance(prop, hyperdb.Link): 508 if isinstance(prop, hyperdb.Link):
509 link = self.db.classes[prop.classname] 509 link = self.db.classes[prop.classname]
510 key = link.labelprop(default_to_id=1) 510 key = link.labelprop(default_to_id=1)

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