comparison roundup/backends/back_anydbm.py @ 2616:eaf74cf96cfa maint-0.7

removed references to py2.3+ boolean values [SF#995682]
author Richard Jones <richard@users.sourceforge.net>
date Thu, 22 Jul 2004 04:46:11 +0000
parents c938aa0af17d
children 17df4dc4ae51
comparison
equal deleted inserted replaced
2613:291c08916e5e 2616:eaf74cf96cfa
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: back_anydbm.py,v 1.146.2.17 2004-07-21 01:02:15 richard Exp $ 18 #$Id: back_anydbm.py,v 1.146.2.18 2004-07-22 04:46:10 richard Exp $
19 '''This module defines a backend that saves the hyperdatabase in a 19 '''This module defines a backend that saves the hyperdatabase in a
20 database chosen by anydbm. It is guaranteed to always be available in python 20 database chosen by anydbm. It is guaranteed to always be available in python
21 versions >2.1.1 (the dumbdbm fallback in 2.1.1 and earlier has several 21 versions >2.1.1 (the dumbdbm fallback in 2.1.1 and earlier has several
22 serious bugs, and is not available) 22 serious bugs, and is not available)
23 ''' 23 '''
1701 continue 1701 continue
1702 1702
1703 # get the node value 1703 # get the node value
1704 nv = node.get(k, None) 1704 nv = node.get(k, None)
1705 1705
1706 match = False 1706 match = 0
1707 1707
1708 # now apply the property filter 1708 # now apply the property filter
1709 if t == LINK: 1709 if t == LINK:
1710 # link - if this node's property doesn't appear in the 1710 # link - if this node's property doesn't appear in the
1711 # filterspec's nodeid list, skip it 1711 # filterspec's nodeid list, skip it
1722 else: 1722 else:
1723 # othewise, make sure this node has each of the 1723 # othewise, make sure this node has each of the
1724 # required values 1724 # required values
1725 for want in v: 1725 for want in v:
1726 if want in nv: 1726 if want in nv:
1727 match = True 1727 match = 1
1728 break 1728 break
1729 elif t == STRING: 1729 elif t == STRING:
1730 if nv is None: 1730 if nv is None:
1731 nv = '' 1731 nv = ''
1732 # RE search 1732 # RE search
1735 if nv is None: 1735 if nv is None:
1736 match = v is None 1736 match = v is None
1737 else: 1737 else:
1738 if v.to_value: 1738 if v.to_value:
1739 if v.from_value <= nv and v.to_value >= nv: 1739 if v.from_value <= nv and v.to_value >= nv:
1740 match = True 1740 match = 1
1741 else: 1741 else:
1742 if v.from_value <= nv: 1742 if v.from_value <= nv:
1743 match = True 1743 match = 1
1744 elif t == OTHER: 1744 elif t == OTHER:
1745 # straight value comparison for the other types 1745 # straight value comparison for the other types
1746 match = nv in v 1746 match = nv in v
1747 if not match: 1747 if not match:
1748 break 1748 break

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