From a4c361720db112dc077d635014985213ef77155f Mon Sep 17 00:00:00 2001 From: richard Date: Thu, 16 Aug 2001 07:34:59 +0000 Subject: [PATCH] better CGI text searching - but hidden filter fields are disappearing... git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@238 57a73879-2fb5-44c3-a270-3262357dd7e2 --- CHANGES.txt | 4 +++ README.txt | 4 +++ roundup/htmltemplate.py | 54 ++++++++++++++++++++++------------------- roundup/hyperdb.py | 15 +++++++----- 4 files changed, 46 insertions(+), 31 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index 5d727ec..ca20775 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -2,6 +2,10 @@ This file contains the changes to the Roundup system over time. The entries are given with the most recent entry first. 2001-xx-xx - 0.2.7 +Feature: + . Text searches are now case insensitive. All forms of text search use + regular expressions now. + Fixed: . Had another 2.1-ism in the unit tests . Made the mail parser a little more robust w.r.t missing Subject: diff --git a/README.txt b/README.txt index a15d3f9..9f17170 100644 --- a/README.txt +++ b/README.txt @@ -105,6 +105,10 @@ cgi_client date: . date subtraction doesn't work correctly "if the dates cross leap years, phases of the moon, ..." +cgi: + . setting an issue to resolved, and no other changes, results in a change + message with no indication of what changed + . enabling a filter disables the current filter hidden fields... 6. Author diff --git a/roundup/htmltemplate.py b/roundup/htmltemplate.py index 1a8e1d9..3d9d69e 100644 --- a/roundup/htmltemplate.py +++ b/roundup/htmltemplate.py @@ -15,7 +15,7 @@ # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. # -# $Id: htmltemplate.py,v 1.20 2001-08-15 23:43:18 richard Exp $ +# $Id: htmltemplate.py,v 1.21 2001-08-16 07:34:59 richard Exp $ import os, re, StringIO, urllib, cgi, errno @@ -505,18 +505,18 @@ def index(client, templates, db, classname, filterspec={}, filter=[], columns = l # now display the index section - w('') - w('') + w('
\n') + w('\n') for name in columns: cname = name.capitalize() if show_display_form: anchor = "%s?%s"%(classname, sortby(name, columns, filter, sort, group, filterspec)) - w(''%( + w('\n'%( anchor, cname)) else: - w(''%cname) - w('') + w('\n'%cname) + w('\n') # this stuff is used for group headings - optimise the group names old_group = None @@ -575,49 +575,49 @@ def index(client, templates, db, classname, filterspec={}, filter=[], # now add in the filter/columns/group/etc config table form w('

') - w('

%s%s%s
%s
') + w('
\n') names = [] for name in cl.getprops().keys(): if name in all_filters or name in all_columns: names.append(name) w('') - w(''% + w('\n'% (len(names)+1)) w('') for name in names: w(''%name.capitalize()) - w('') + w('\n') # filter if all_filters: - w('') + w('\n') for name in names: if name not in all_filters: w('') continue if name in filter: checked=' checked' else: checked='' - w(''%(name, - checked)) - w('') + w('\n'%( + name, checked)) + w('\n') # columns if all_columns: - w('') + w('\n') for name in names: if name not in all_columns: w('') continue if name in columns: checked=' checked' else: checked='' - w(''%( + w('\n'%( name, checked)) - w('') + w('\n') # group - w('') + w('\n') for name in names: prop = properties[name] if name not in all_columns: @@ -625,16 +625,16 @@ def index(client, templates, db, classname, filterspec={}, filter=[], continue if name in group: checked=' checked' else: checked='' - w(''%( + w('\n'%( name, checked)) - w('') + w('\n') w('') w('') - w('
View customisation...
View customisation...
 %s
Filters
Filters ') - w('
\n') + w('
Columns
Columns ') - w('\n') + w('
Grouping
Grouping') - w('\n') + w('
 '%len(names)) - w('
') - w('') + w('\n') + w('\n') + w('\n') # @@ -742,6 +742,10 @@ def newitem(client, templates, db, classname, form, replace=re.compile( # # $Log: not supported by cvs2svn $ +# Revision 1.20 2001/08/15 23:43:18 richard +# Fixed some isFooTypes that I missed. +# Refactored some code in the CGI code. +# # Revision 1.19 2001/08/12 06:32:36 richard # using isinstance(blah, Foo) now instead of isFooType # diff --git a/roundup/hyperdb.py b/roundup/hyperdb.py index 6951a6f..3cb774a 100644 --- a/roundup/hyperdb.py +++ b/roundup/hyperdb.py @@ -15,7 +15,7 @@ # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. # -# $Id: hyperdb.py,v 1.17 2001-08-16 06:59:58 richard Exp $ +# $Id: hyperdb.py,v 1.18 2001-08-16 07:34:59 richard Exp $ # standard python modules import cPickle, re, string @@ -567,11 +567,11 @@ class Class: u.append(entry) l.append((1, k, u)) elif isinstance(propclass, String): - if '*' in v or '?' in v: - # simple glob searching - v = v.replace('?', '.') - v = v.replace('*', '.*?') - l.append((2, k, re.compile(v, re.I))) + # simple glob searching + v = re.sub(r'([\|\{\}\\\.\+\[\]\(\)])', r'\\\1', v) + v = v.replace('?', '.') + v = v.replace('*', '.*?') + l.append((2, k, re.compile(v, re.I))) else: l.append((6, k, v)) filterspec = l @@ -794,6 +794,9 @@ def Choice(name, *options): # # $Log: not supported by cvs2svn $ +# Revision 1.17 2001/08/16 06:59:58 richard +# all searches use re now - and they're all case insensitive +# # Revision 1.16 2001/08/15 23:43:18 richard # Fixed some isFooTypes that I missed. # Refactored some code in the CGI code. -- 2.30.2