Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
67f9aa36
Commit
67f9aa36
authored
Aug 01, 2010
by
Hanno Schlichting
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid some really old-style pseudo performance hacks
parent
dfb397dc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
22 deletions
+24
-22
src/Products/ZCatalog/ZCatalog.py
src/Products/ZCatalog/ZCatalog.py
+24
-22
No files found.
src/Products/ZCatalog/ZCatalog.py
View file @
67f9aa36
...
...
@@ -167,8 +167,8 @@ class ZCatalog(Folder, Persistent, Implicit):
def
manage_edit
(
self
,
RESPONSE
,
URL1
,
threshold
=
1000
,
REQUEST
=
None
):
""" edit the catalog """
if
type
(
threshold
)
is
not
type
(
1
):
threshold
=
int
(
threshold
)
if
not
isinstance
(
threshold
,
int
):
threshold
=
int
(
threshold
)
self
.
threshold
=
threshold
RESPONSE
.
redirect
(
...
...
@@ -923,40 +923,42 @@ class td(RestrictedDTML, TemplateDict):
pass
def
expr_match
(
ob
,
ed
,
c
=
InstanceDict
,
r
=
0
):
def
expr_match
(
ob
,
ed
):
e
,
md
,
push
,
pop
=
ed
push
(
c
(
ob
,
md
))
push
(
InstanceDict
(
ob
,
md
))
r
=
0
try
:
r
=
e
.
eval
(
md
)
finally
:
pop
()
return
r
_marker
=
object
()
def
mtime_match
(
ob
,
t
,
q
,
fn
=
hasattr
):
if
not
fn
(
ob
,
'_p_mtime'
):
return
0
return
q
==
'<'
and
(
ob
.
_p_mtime
<
t
)
or
(
ob
.
_p_mtime
>
t
)
def
mtime_match
(
ob
,
t
,
q
):
mtime
=
getattr
(
ob
,
'_p_mtime'
,
_marker
)
if
mtime
is
_marker
():
return
False
return
q
==
'<'
and
(
mtime
<
t
)
or
(
mtime
>
t
)
def
role_match
(
ob
,
permission
,
roles
,
lt
=
type
([]),
tt
=
type
(())):
pr
=
[]
fn
=
pr
.
append
while
1
:
if
hasattr
(
ob
,
permission
):
p
=
getattr
(
ob
,
permission
)
if
type
(
p
)
is
lt
:
map
(
fn
,
p
)
def
role_match
(
ob
,
permission
,
roles
):
pr
=
[]
while
True
:
p
=
getattr
(
ob
,
permission
,
_marker
)
if
p
is
not
_marker
:
if
isinstance
(
p
,
list
):
pr
.
append
(
p
)
ob
=
aq_parent
(
ob
)
if
ob
is
not
None
:
continue
break
if
type
(
p
)
is
tt
:
map
(
fn
,
p
)
if
isinstance
(
p
,
tuple
)
:
pr
.
append
(
p
)
break
if
p
is
None
:
map
(
fn
,
(
'Manager'
,
'Anonymous'
))
pr
.
append
(
(
'Manager'
,
'Anonymous'
))
break
ob
=
aq_parent
(
ob
)
...
...
@@ -965,6 +967,6 @@ def role_match(ob, permission, roles, lt=type([]), tt=type(())):
break
for
role
in
roles
:
if
not
(
role
in
pr
)
:
return
0
return
1
if
role
not
in
pr
:
return
False
return
True
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment