From: richard Date: Thu, 26 Sep 2002 21:54:18 +0000 (+0000) Subject: - merge Zope Collector #538 fix from ZPT CVS trunk (path expressions with a X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=a30b78526532bb0bf883224d43b1b51c24d6b831;p=roundup.git - merge Zope Collector #538 fix from ZPT CVS trunk (path expressions with a non-path final alternate no longer try to call a value returned by that alternate) - merge Zope Collector #573 fix from ZPT CVS trunk - added 1000-user/issue benchmark test git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@1269 57a73879-2fb5-44c3-a270-3262357dd7e2 --- diff --git a/CHANGES.txt b/CHANGES.txt index ecaf45f..95d61b7 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -36,7 +36,13 @@ are given with the most recent entry first. - handle stupid mailers that QUOTE their Re; 'Re: "[issue1] bla blah"' - giving a user a Role that doesn't exist doesn't break stuff any more - revamped user guide, customisation guide, added maintenance guide +- merge Zope Collector #538 fix from ZPT CVS trunk (path expressions with a + non-path final alternate no longer try to call a value returned by that + alternate) +- merge Zope Collector #573 fix from ZPT CVS trunk - merge Zope Collector #580 fix from ZPT CVS trunk +- added "crypt" password encoding and ability to set password with + already encrypted password through roundup-admin 2002-09-13 0.5.0 beta2 diff --git a/roundup/cgi/PageTemplates/Expressions.py b/roundup/cgi/PageTemplates/Expressions.py index 25b605c..8a391b6 100644 --- a/roundup/cgi/PageTemplates/Expressions.py +++ b/roundup/cgi/PageTemplates/Expressions.py @@ -25,7 +25,7 @@ Modified for Roundup 0.5 release: """ -__version__='$Revision: 1.7 $'[11:-2] +__version__='$Revision: 1.8 $'[11:-2] import re, sys from TALES import Engine, CompilerError, _valid_name, NAME_RE, \ @@ -136,6 +136,7 @@ class PathExpr: def __init__(self, name, expr, engine): self._s = expr self._name = name + self._hybrid = 0 paths = split(expr, '|') self._subexprs = [] add = self._subexprs.append @@ -145,6 +146,7 @@ class PathExpr: # This part is the start of another expression type, # so glue it back together and compile it. add(engine.compile(lstrip(join(paths[i:], '|')))) + self._hybrid = 1 break add(SubPathExpr(path)._eval) @@ -169,8 +171,11 @@ class PathExpr: else: break else: - # On the last subexpression allow exceptions through. + # On the last subexpression allow exceptions through, and + # don't autocall if the expression was not a subpath. ob = self._subexprs[-1](econtext) + if self._hybrid: + return ob if self._name == 'nocall' or isinstance(ob, StringType): return ob diff --git a/roundup/cgi/ZTUtils/Iterator.py b/roundup/cgi/ZTUtils/Iterator.py index d13b5c2..b6c7a6f 100644 --- a/roundup/cgi/ZTUtils/Iterator.py +++ b/roundup/cgi/ZTUtils/Iterator.py @@ -18,8 +18,8 @@ The Iterator() function accepts either a sequence or a Python iterator. The next() method fetches the next item, and returns true if it succeeds. -$Id: Iterator.py,v 1.1 2002-09-05 00:37:09 richard Exp $''' -__version__='$Revision: 1.1 $'[11:-2] +$Id: Iterator.py,v 1.2 2002-09-26 21:54:17 richard Exp $''' +__version__='$Revision: 1.2 $'[11:-2] import string @@ -137,7 +137,7 @@ class SeqInner(InnerBase): def _supports(self, ob): try: ob[0] - except TypeError: return 0 + except (TypeError, AttributeError): return 0 except: pass return 1 diff --git a/test/benchmark.py b/test/benchmark.py index 99f58b9..bb51f45 100644 --- a/test/benchmark.py +++ b/test/benchmark.py @@ -141,4 +141,7 @@ if __name__ == '__main__': main(name, numissues=20) for name in 'anydbm bsddb bsddb3 metakit sqlite'.split(): main(name, numissues=100) + # don't even bother benchmarking the dbm backends > 100! + for name in 'metakit sqlite'.split(): + main(name, numissues=1000)