Mercurial > p > roundup > code
comparison roundup/backends/back_anydbm.py @ 2601:113548baeed2
API clarification.
Previously, the anydbm/bsddb/metakit filter() methods had required
exact matches to Multilink argument lists. The RDBMS backends treated
Multilink matches like all other data types - matching any of the
Multilink argument list is good enough. The latter behaviour is
implemented across the board now.
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Tue, 20 Jul 2004 22:56:18 +0000 |
| parents | f25ff5a05abd |
| children | 17eb5aeada7f |
comparison
equal
deleted
inserted
replaced
| 2600:f25ff5a05abd | 2601:113548baeed2 |
|---|---|
| 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.162 2004-07-20 07:26:40 richard Exp $ | 18 #$Id: back_anydbm.py,v 1.163 2004-07-20 22:56:18 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 ''' |
| 1534 | 1534 |
| 1535 "search_matches" is {nodeid: marker} or None | 1535 "search_matches" is {nodeid: marker} or None |
| 1536 | 1536 |
| 1537 The filter must match all properties specificed - but if the | 1537 The filter must match all properties specificed - but if the |
| 1538 property value to match is a list, any one of the values in the | 1538 property value to match is a list, any one of the values in the |
| 1539 list may match for that property to match. Unless the property | 1539 list may match for that property to match. |
| 1540 is a Multilink, in which case the item's property list must | |
| 1541 match the filterspec list. | |
| 1542 """ | 1540 """ |
| 1543 if __debug__: | 1541 if __debug__: |
| 1544 start_t = time.time() | 1542 start_t = time.time() |
| 1545 | 1543 |
| 1546 cn = self.classname | 1544 cn = self.classname |
| 1664 match = not nv | 1662 match = not nv |
| 1665 else: | 1663 else: |
| 1666 # othewise, make sure this node has each of the | 1664 # othewise, make sure this node has each of the |
| 1667 # required values | 1665 # required values |
| 1668 for want in v: | 1666 for want in v: |
| 1669 if want not in nv: | 1667 if want in nv: |
| 1668 match = True | |
| 1670 break | 1669 break |
| 1671 else: | |
| 1672 match = True | |
| 1673 elif t == STRING: | 1670 elif t == STRING: |
| 1674 if nv is None: | 1671 if nv is None: |
| 1675 nv = '' | 1672 nv = '' |
| 1676 # RE search | 1673 # RE search |
| 1677 match = v.search(nv) | 1674 match = v.search(nv) |
