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
afb0beb0
Commit
afb0beb0
authored
Aug 16, 2001
by
Evan Simpson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix incompatibilities and attribution
parent
2c4d2864
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
13 deletions
+31
-13
lib/python/ZTUtils/CHANGES.txt
lib/python/ZTUtils/CHANGES.txt
+5
-1
lib/python/ZTUtils/Zope.py
lib/python/ZTUtils/Zope.py
+26
-12
No files found.
lib/python/ZTUtils/CHANGES.txt
View file @
afb0beb0
...
@@ -4,10 +4,13 @@ ZTUtils changes
...
@@ -4,10 +4,13 @@ ZTUtils changes
Change information for previous versions can be found in the
Change information for previous versions can be found in the
file HISTORY.txt.
file HISTORY.txt.
Version 1.1.
0
Version 1.1.
1
Features Added
Features Added
- Used an algorithm submitted by Tino Wildenhain to add
Roman numeral support to Iterators.
- TreeMakers have a setChildAccess() method that you can use
- TreeMakers have a setChildAccess() method that you can use
to control tree construction. Child nodes can be accessed
to control tree construction. Child nodes can be accessed
through either an attribute name or callback function.
through either an attribute name or callback function.
...
@@ -38,3 +41,4 @@ ZTUtils changes
...
@@ -38,3 +41,4 @@ ZTUtils changes
Bugs Fixed
Bugs Fixed
- Version 1.1.0 broke on Python 1.5.2 and Zope <2.4
lib/python/ZTUtils/Zope.py
View file @
afb0beb0
...
@@ -84,20 +84,31 @@
...
@@ -84,20 +84,31 @@
##############################################################################
##############################################################################
__doc__
=
'''Zope-specific versions of ZTUTils classes
__doc__
=
'''Zope-specific versions of ZTUTils classes
$Id: Zope.py,v 1.
2 2001/08/13 18:15:34
evan Exp $'''
$Id: Zope.py,v 1.
3 2001/08/16 17:42:53
evan Exp $'''
__version__
=
'$Revision: 1.
2
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.
3
$'
[
11
:
-
2
]
import
sys
,
cgi
,
urllib
,
cgi
import
sys
,
cgi
,
urllib
,
cgi
from
Tree
import
encodeExpansion
,
decodeExpansion
,
TreeMaker
from
Tree
import
encodeExpansion
,
decodeExpansion
,
TreeMaker
from
SimpleTree
import
SimpleTreeMaker
from
SimpleTree
import
SimpleTreeMaker
from
Batch
import
Batch
from
Batch
import
Batch
from
Products.ZCatalog.Lazy
import
Lazy
from
Products.ZCatalog.Lazy
import
Lazy
from
AccessControl.ZopeGuards
import
guarded_getitem
from
AccessControl
import
getSecurityManager
from
AccessControl
import
getSecurityManager
,
Unauthorized
from
string
import
split
,
join
from
string
import
split
,
join
from
types
import
StringType
,
ListType
,
IntType
,
FloatType
from
types
import
StringType
,
ListType
,
IntType
,
FloatType
from
DateTime
import
DateTime
from
DateTime
import
DateTime
try
:
from
AccessControl.ZopeGuards
import
guarded_getitem
except
ImportError
:
Unauthorized
=
'Unauthorized'
def
guarded_getitem
(
object
,
index
):
v
=
object
[
index
]
if
getSecurityManager
().
validate
(
object
,
object
,
index
,
v
):
return
v
raise
Unauthorized
,
'unauthorized access to element %s'
%
`i`
else
:
from
AccessControl
import
Unauthorized
class
LazyFilter
(
Lazy
):
class
LazyFilter
(
Lazy
):
# A LazyFilter that checks with the security policy
# A LazyFilter that checks with the security policy
...
@@ -128,24 +139,27 @@ class LazyFilter(Lazy):
...
@@ -128,24 +139,27 @@ class LazyFilter(Lazy):
e
=
self
.
_eindex
e
=
self
.
_eindex
skip
=
self
.
_skip
skip
=
self
.
_skip
while
i
>
ind
:
while
i
>
ind
:
e
=
e
+
1
try
:
try
:
e
=
e
+
1
try
:
v
=
guarded_getitem
(
s
,
e
)
try
:
v
=
guarded_getitem
(
s
,
e
)
except
Unauthorized
,
vv
:
except
'Unauthorized'
,
vv
:
if
skip
is
None
:
if
skip
is
None
:
msg
=
'(item %s): %s'
%
(
index
,
vv
)
msg
=
'(item %s): %s'
%
(
index
,
vv
)
raise
Unauthorized
,
msg
,
sys
.
exc_info
()[
2
]
raise
Unauthorized
,
msg
,
sys
.
exc_info
()[
2
]
continue
skip_this
=
1
if
skip
and
not
getSecurityManager
().
checkPermission
(
skip
,
v
):
else
:
continue
skip_this
=
0
if
test
is
None
or
test
(
v
):
data
.
append
(
v
)
ind
=
ind
+
1
except
IndexError
:
except
IndexError
:
del
self
.
_test
del
self
.
_test
del
self
.
_seq
del
self
.
_seq
del
self
.
_eindex
del
self
.
_eindex
raise
IndexError
,
index
raise
IndexError
,
index
if
skip_this
:
continue
if
skip
and
not
getSecurityManager
().
checkPermission
(
skip
,
v
):
continue
if
test
is
None
or
test
(
v
):
data
.
append
(
v
)
ind
=
ind
+
1
self
.
_eindex
=
e
self
.
_eindex
=
e
return
data
[
i
]
return
data
[
i
]
...
...
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