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
090a32d4
Commit
090a32d4
authored
Sep 10, 2004
by
Andreas Jung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Collector #1477: TaintedString.strip() now implements the
same signature as str.strip()
parent
3bbe1fb0
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
1 deletion
+18
-1
doc/CHANGES.txt
doc/CHANGES.txt
+3
-0
lib/python/ZPublisher/TaintedString.py
lib/python/ZPublisher/TaintedString.py
+9
-1
lib/python/ZPublisher/tests/testTaintedString.py
lib/python/ZPublisher/tests/testTaintedString.py
+6
-0
No files found.
doc/CHANGES.txt
View file @
090a32d4
...
...
@@ -157,6 +157,9 @@ Zope Changes
Bugs fixed
- Collector #1477: TaintedString.strip() now implements the
same signature as str.strip()
- TAL: tal:on-error does not trap ConflictError anymore.
- OFS.CopySupport: Enforced "Delete objects" permission during
...
...
lib/python/ZPublisher/TaintedString.py
View file @
090a32d4
...
...
@@ -131,13 +131,21 @@ def createSimpleWrapper(func):
def
createOneArgWrapper
(
func
):
return
lambda
s
,
a
,
f
=
func
:
s
.
__class__
(
getattr
(
s
.
_value
,
f
)(
a
))
def
createOneOptArgWrapper
(
func
):
return
lambda
s
,
a
=
None
,
f
=
func
:
s
.
__class__
(
getattr
(
s
.
_value
,
f
)(
a
))
simpleWrappedMethods
=
\
"capitalize lower
lstrip rstrip strip
swapcase title upper"
.
split
()
"capitalize lower swapcase title upper"
.
split
()
oneArgWrappedMethods
=
"center join ljust rjust"
.
split
()
oneOptArgWrappedMethods
=
"lstrip rstrip strip"
.
split
()
for
f
in
simpleWrappedMethods
:
setattr
(
TaintedString
,
f
,
createSimpleWrapper
(
f
))
for
f
in
oneArgWrappedMethods
:
setattr
(
TaintedString
,
f
,
createOneArgWrapper
(
f
))
for
f
in
oneOptArgWrappedMethods
:
setattr
(
TaintedString
,
f
,
createOneOptArgWrapper
(
f
))
lib/python/ZPublisher/tests/testTaintedString.py
View file @
090a32d4
...
...
@@ -90,6 +90,12 @@ class TestTaintedString(unittest.TestCase):
else
:
self
.
failIf
(
isinstance
(
v
,
self
.
_getClass
()))
optArg
=
"lstrip rstrip strip"
.
split
()
for
f
in
optArg
:
v
=
getattr
(
tainted
,
f
)(
" "
)
self
.
assertEquals
(
v
,
getattr
(
unquoted
,
f
)(
" "
))
self
.
assert_
(
isinstance
(
v
,
self
.
_getClass
()))
justify
=
"center ljust rjust"
.
split
()
for
f
in
justify
:
v
=
getattr
(
tainted
,
f
)(
30
)
...
...
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