Attachment 'search_quote.patch'

Download

   1 * looking for nirs@freeshell.org--2005/moin--fix--1.3--patch-27 to compare with
   2 * comparing to nirs@freeshell.org--2005/moin--fix--1.3--patch-27
   3 M  MoinMoin/search.py
   4 
   5 * modified files
   6 
   7 
   8 --- orig/MoinMoin/search.py
   9 +++ mod/MoinMoin/search.py
  10 @@ -674,8 +674,8 @@
  11              return None
  12          modifiers = match.group('MOD').split(":")[:-1]
  13          text = match.group('TERM')
  14 -        if ((text[0] == text[-1] == '"') or
  15 -            (text[0] == text[-1] == "'")): text = text[1:-1]
  16 +        if self.isQuoted(text):
  17 +            text = text[1:-1]
  18  
  19          title_search = self.titlesearch
  20          regex = self.regex
  21 @@ -703,6 +703,13 @@
  22              obj.negate()
  23          return obj                
  24  
  25 +    def isQuoted(self, text):
  26 +        # Empty string '' is not considered quoted
  27 +        if len(text) < 3:
  28 +            return False
  29 +        return (text.startswith('"') and text.endswith('"') or
  30 +                text.startswith("'") and text.endswith("'"))
  31 +
  32  
  33  class SearchResults:
  34      """ Manage search results, supply different views

Attached Files

To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.
  • [get | view] (2005-04-28 23:15:35, 1.0 KB) [[attachment:search_quote.patch]]
 All files | Selected Files: delete move to page copy to page

You are not allowed to attach a file to this page.