Added regexp matching for Location search
authorW. Trevor King <wking@drexel.edu>
Fri, 29 Aug 2008 08:39:58 +0000 (04:39 -0400)
committerW. Trevor King <wking@drexel.edu>
Fri, 29 Aug 2008 08:39:58 +0000 (04:39 -0400)
chem_web.py

index c49ffc7d576fd7d3d09d43bd7cc4e5df663051b7..9dc68f0d73e2c9c4e05676e1c9d80c6ed969fad7 100755 (executable)
@@ -189,8 +189,8 @@ class docs (object) :
             db._refresh()
             formdata = web.input()
             user_regexp = formdata['regexp']
-            regexp = self.validate_string(user_regexp)
-            path = dgen.door_warning(lambda r: r['Location'] == regexp ) # no regexp matching yet, work in progress
+            regexp = re.compile(self.validate_string(user_regexp), 'I') # Case insensitive
+            path = dgen.door_warning(lambda r: regexp.match(r['Location']))
             print file(path, 'rb').read() ,
       def validate_string(self, string): # work in progress
             return string