diff hyperdb.py @ 3:97559f7bae2e

Bug fixes: . Fixed bug in re generation in the filter (I hadn't finished the code ;) . Added TODO as a priority (between bug and usability) . Fixed handling of None String property in grouped list headings
author Richard Jones <richard@users.sourceforge.net>
date Thu, 19 Jul 2001 05:23:09 +0000
parents 5e92642cd1f8
children 72a0ba086b3e
line wrap: on
line diff
--- a/hyperdb.py	Thu Jul 19 03:12:56 2001 +0000
+++ b/hyperdb.py	Thu Jul 19 05:23:09 2001 +0000
@@ -648,8 +648,9 @@
                 v = v[0]
                 if '*' in v or '?' in v:
                     # simple glob searching
-                    v = v.replace(v, '?', '.')
-                    v = v.replace(v, '*', '.*?')
+                    v = v.replace('?', '.')
+                    v = v.replace('*', '.*?')
+                    v = re.compile(v)
                     l.append((2, k, v))
                 elif v[0] == '^':
                     # start-anchored
@@ -690,7 +691,7 @@
                     else:
                         continue
                     break
-                elif t == 2 and not v.match(node[k]):
+                elif t == 2 and not v.search(node[k]):
                     # RE search
                     break
                 elif t == 3 and node[k][:len(v)] != v:
@@ -748,10 +749,10 @@
 
                     # String and Date values are sorted in the natural way
                     if propclass.isStringType:
-                        # make sure that case doesn't get involved
-                        if av[0] in string.uppercase:
+                        # clean up the strings
+                        if av and av[0] in string.uppercase:
                             av = an[prop] = av.lower()
-                        if bv[0] in string.uppercase:
+                        if bv and bv[0] in string.uppercase:
                             bv = bn[prop] = bv.lower()
                     if propclass.isStringType or propclass.isDateType:
                         if dir == '+':

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