changeset 3828:d125f175fc2e

merge bugfixes from 1.7
author Johannes Berg <johannes AT sipsolutions DOT net>
date Fri, 11 Jul 2008 13:40:52 +0200
parents aef3adf3f701 (current diff) a53e20c3ebab (diff)
children 8fea1d0ca8ac
files MoinMoin/wikiutil.py
diffstat 2 files changed, 8 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/search/queryparser.py	Fri Jul 11 10:28:38 2008 +0200
+++ b/MoinMoin/search/queryparser.py	Fri Jul 11 13:40:52 2008 +0200
@@ -996,7 +996,9 @@
                 domain = False
                 while len(item) > 1:
                     m = item[0]
-                    if m == M:
+                    if m is None:
+                        raise ValueError("Invalid search prefix")
+                    elif m == M:
                         negate = True
                     elif "title".startswith(m):
                         title_search = True
@@ -1014,6 +1016,8 @@
                         mimetype = True
                     elif "domain".startswith(m):
                         domain = True
+                    else:
+                        raise ValueError("Invalid search prefix")
                     item = item[1:]
 
                 text = item[0]
@@ -1054,8 +1058,8 @@
                                                         brackets=('()', ),
                                                         quotes='\'"')
             logging.debug("parse_quoted_separated items: %r" % items)
-        except wikiutil.BracketError:
-            raise ValueError()
+        except wikiutil.BracketError, err:
+            raise ValueError(str(err))
         query = self._analyse_items(items)
         logging.debug("analyse_items query: %r" % query)
         return query
--- a/MoinMoin/wikiutil.py	Fri Jul 11 10:28:38 2008 +0200
+++ b/MoinMoin/wikiutil.py	Fri Jul 11 13:40:52 2008 +0200
@@ -1767,7 +1767,7 @@
         """
         IEFArgument.__init__(self)
         self._units = list(units)
-        self._units.sort(cmp=lambda x, y: len(y) - len(x))
+        self._units.sort(lambda x, y: len(y) - len(x))
         self._type = argtype
         self._defaultunit = defaultunit
         assert defaultunit is None or defaultunit in units