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
e04ad274
Commit
e04ad274
authored
Jan 27, 2004
by
Fred Drake
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change port of the fix for collector issue 1203:
Python 2.3.3 doesn't need to import the types module here anymore
parent
f2bb2144
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
11 deletions
+9
-11
lib/python/ZTUtils/Zope.py
lib/python/ZTUtils/Zope.py
+9
-11
No files found.
lib/python/ZTUtils/Zope.py
View file @
e04ad274
...
...
@@ -12,8 +12,8 @@
##############################################################################
__doc__
=
'''Zope-specific versions of ZTUTils classes
$Id: Zope.py,v 1.1
4 2004/01/27 14:39:34 tseaver
Exp $'''
__version__
=
'$Revision: 1.1
4
$'
[
11
:
-
2
]
$Id: Zope.py,v 1.1
5 2004/01/27 15:47:02 fdrake
Exp $'''
__version__
=
'$Revision: 1.1
5
$'
[
11
:
-
2
]
import
sys
,
cgi
,
urllib
,
cgi
from
Tree
import
encodeExpansion
,
decodeExpansion
,
TreeMaker
...
...
@@ -21,7 +21,6 @@ from SimpleTree import SimpleTreeMaker
from
Batch
import
Batch
from
Products.ZCatalog.Lazy
import
Lazy
from
AccessControl
import
getSecurityManager
from
types
import
StringType
,
ListType
,
IntType
,
FloatType
from
DateTime
import
DateTime
try
:
...
...
@@ -36,7 +35,6 @@ except ImportError:
else
:
from
AccessControl
import
Unauthorized
from
types
import
BooleanType
class
LazyFilter
(
Lazy
):
# A LazyFilter that checks with the security policy
...
...
@@ -233,14 +231,14 @@ def complex_marshal(pairs):
k
,
v
=
pairs
[
i
]
m
=
''
sublist
=
None
if
isinstance
(
v
,
StringType
):
if
isinstance
(
v
,
str
):
pass
elif
hasattr
(
v
,
'items'
):
sublist
=
[]
for
sk
,
sv
in
v
.
items
():
sm
=
simple_marshal
(
sv
)
sublist
.
append
((
'%s.%s'
%
(
k
,
sk
),
'%s:record'
%
sm
,
sv
))
elif
isinstance
(
v
,
ListType
):
elif
isinstance
(
v
,
list
):
sublist
=
[]
for
sv
in
v
:
sm
=
simple_marshal
(
sv
)
...
...
@@ -255,13 +253,13 @@ def complex_marshal(pairs):
return
pairs
def
simple_marshal
(
v
):
if
isinstance
(
v
,
StringType
):
if
isinstance
(
v
,
str
):
return
''
if
isinstance
(
v
,
BooleanType
):
if
isinstance
(
v
,
bool
):
return
':boolean'
if
isinstance
(
v
,
IntType
):
if
isinstance
(
v
,
int
):
return
':int'
if
isinstance
(
v
,
FloatType
):
if
isinstance
(
v
,
float
):
return
':float'
if
isinstance
(
v
,
DateTime
):
return
':date'
...
...
@@ -283,7 +281,7 @@ def url_query(request, req_name="URL", omit=None):
if
qs
and
omit
:
qsparts
=
qs
.
split
(
'&'
)
if
isinstance
(
omit
,
StringType
):
if
isinstance
(
omit
,
str
):
omits
=
{
omit
:
None
}
else
:
omits
=
{}
...
...
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