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
Show 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 @@
...
@@ -12,8 +12,8 @@
##############################################################################
##############################################################################
__doc__
=
'''Zope-specific versions of ZTUTils classes
__doc__
=
'''Zope-specific versions of ZTUTils classes
$Id: Zope.py,v 1.1
4 2004/01/27 14:39:34 tseaver
Exp $'''
$Id: Zope.py,v 1.1
5 2004/01/27 15:47:02 fdrake
Exp $'''
__version__
=
'$Revision: 1.1
4
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.1
5
$'
[
11
:
-
2
]
import
sys
,
cgi
,
urllib
,
cgi
import
sys
,
cgi
,
urllib
,
cgi
from
Tree
import
encodeExpansion
,
decodeExpansion
,
TreeMaker
from
Tree
import
encodeExpansion
,
decodeExpansion
,
TreeMaker
...
@@ -21,7 +21,6 @@ from SimpleTree import SimpleTreeMaker
...
@@ -21,7 +21,6 @@ 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
import
getSecurityManager
from
AccessControl
import
getSecurityManager
from
types
import
StringType
,
ListType
,
IntType
,
FloatType
from
DateTime
import
DateTime
from
DateTime
import
DateTime
try
:
try
:
...
@@ -36,7 +35,6 @@ except ImportError:
...
@@ -36,7 +35,6 @@ except ImportError:
else
:
else
:
from
AccessControl
import
Unauthorized
from
AccessControl
import
Unauthorized
from
types
import
BooleanType
class
LazyFilter
(
Lazy
):
class
LazyFilter
(
Lazy
):
# A LazyFilter that checks with the security policy
# A LazyFilter that checks with the security policy
...
@@ -233,14 +231,14 @@ def complex_marshal(pairs):
...
@@ -233,14 +231,14 @@ def complex_marshal(pairs):
k
,
v
=
pairs
[
i
]
k
,
v
=
pairs
[
i
]
m
=
''
m
=
''
sublist
=
None
sublist
=
None
if
isinstance
(
v
,
StringType
):
if
isinstance
(
v
,
str
):
pass
pass
elif
hasattr
(
v
,
'items'
):
elif
hasattr
(
v
,
'items'
):
sublist
=
[]
sublist
=
[]
for
sk
,
sv
in
v
.
items
():
for
sk
,
sv
in
v
.
items
():
sm
=
simple_marshal
(
sv
)
sm
=
simple_marshal
(
sv
)
sublist
.
append
((
'%s.%s'
%
(
k
,
sk
),
'%s:record'
%
sm
,
sv
))
sublist
.
append
((
'%s.%s'
%
(
k
,
sk
),
'%s:record'
%
sm
,
sv
))
elif
isinstance
(
v
,
ListType
):
elif
isinstance
(
v
,
list
):
sublist
=
[]
sublist
=
[]
for
sv
in
v
:
for
sv
in
v
:
sm
=
simple_marshal
(
sv
)
sm
=
simple_marshal
(
sv
)
...
@@ -255,13 +253,13 @@ def complex_marshal(pairs):
...
@@ -255,13 +253,13 @@ def complex_marshal(pairs):
return
pairs
return
pairs
def
simple_marshal
(
v
):
def
simple_marshal
(
v
):
if
isinstance
(
v
,
StringType
):
if
isinstance
(
v
,
str
):
return
''
return
''
if
isinstance
(
v
,
BooleanType
):
if
isinstance
(
v
,
bool
):
return
':boolean'
return
':boolean'
if
isinstance
(
v
,
IntType
):
if
isinstance
(
v
,
int
):
return
':int'
return
':int'
if
isinstance
(
v
,
FloatType
):
if
isinstance
(
v
,
float
):
return
':float'
return
':float'
if
isinstance
(
v
,
DateTime
):
if
isinstance
(
v
,
DateTime
):
return
':date'
return
':date'
...
@@ -283,7 +281,7 @@ def url_query(request, req_name="URL", omit=None):
...
@@ -283,7 +281,7 @@ def url_query(request, req_name="URL", omit=None):
if
qs
and
omit
:
if
qs
and
omit
:
qsparts
=
qs
.
split
(
'&'
)
qsparts
=
qs
.
split
(
'&'
)
if
isinstance
(
omit
,
StringType
):
if
isinstance
(
omit
,
str
):
omits
=
{
omit
:
None
}
omits
=
{
omit
:
None
}
else
:
else
:
omits
=
{}
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