Skip to content

Commit 00694ae

Browse files
author
Richard Jones
committed
Zope Collector fixes.
- 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
1 parent 5d59f6f commit 00694ae

File tree

4 files changed

+19
-5
lines changed

4 files changed

+19
-5
lines changed

CHANGES.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,13 @@ are given with the most recent entry first.
3636
- handle stupid mailers that QUOTE their Re; 'Re: "[issue1] bla blah"'
3737
- giving a user a Role that doesn't exist doesn't break stuff any more
3838
- revamped user guide, customisation guide, added maintenance guide
39+
- merge Zope Collector #538 fix from ZPT CVS trunk (path expressions with a
40+
non-path final alternate no longer try to call a value returned by that
41+
alternate)
42+
- merge Zope Collector #573 fix from ZPT CVS trunk
3943
- merge Zope Collector #580 fix from ZPT CVS trunk
44+
- added "crypt" password encoding and ability to set password with
45+
already encrypted password through roundup-admin
4046

4147

4248
2002-09-13 0.5.0 beta2

roundup/cgi/PageTemplates/Expressions.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
2626
"""
2727

28-
__version__='$Revision: 1.7 $'[11:-2]
28+
__version__='$Revision: 1.8 $'[11:-2]
2929

3030
import re, sys
3131
from TALES import Engine, CompilerError, _valid_name, NAME_RE, \
@@ -136,6 +136,7 @@ class PathExpr:
136136
def __init__(self, name, expr, engine):
137137
self._s = expr
138138
self._name = name
139+
self._hybrid = 0
139140
paths = split(expr, '|')
140141
self._subexprs = []
141142
add = self._subexprs.append
@@ -145,6 +146,7 @@ def __init__(self, name, expr, engine):
145146
# This part is the start of another expression type,
146147
# so glue it back together and compile it.
147148
add(engine.compile(lstrip(join(paths[i:], '|'))))
149+
self._hybrid = 1
148150
break
149151
add(SubPathExpr(path)._eval)
150152

@@ -169,8 +171,11 @@ def _eval(self, econtext,
169171
else:
170172
break
171173
else:
172-
# On the last subexpression allow exceptions through.
174+
# On the last subexpression allow exceptions through, and
175+
# don't autocall if the expression was not a subpath.
173176
ob = self._subexprs[-1](econtext)
177+
if self._hybrid:
178+
return ob
174179

175180
if self._name == 'nocall' or isinstance(ob, StringType):
176181
return ob

roundup/cgi/ZTUtils/Iterator.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
iterator. The next() method fetches the next item, and returns
1919
true if it succeeds.
2020
21-
$Id: Iterator.py,v 1.1 2002-09-05 00:37:09 richard Exp $'''
22-
__version__='$Revision: 1.1 $'[11:-2]
21+
$Id: Iterator.py,v 1.2 2002-09-26 21:54:17 richard Exp $'''
22+
__version__='$Revision: 1.2 $'[11:-2]
2323

2424
import string
2525

@@ -137,7 +137,7 @@ class SeqInner(InnerBase):
137137

138138
def _supports(self, ob):
139139
try: ob[0]
140-
except TypeError: return 0
140+
except (TypeError, AttributeError): return 0
141141
except: pass
142142
return 1
143143

test/benchmark.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,4 +141,7 @@ def main(backendname, time=time.time, numissues=10):
141141
main(name, numissues=20)
142142
for name in 'anydbm bsddb bsddb3 metakit sqlite'.split():
143143
main(name, numissues=100)
144+
# don't even bother benchmarking the dbm backends > 100!
145+
for name in 'metakit sqlite'.split():
146+
main(name, numissues=1000)
144147

0 commit comments

Comments
 (0)