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
2e77beba
Commit
2e77beba
authored
Apr 24, 2001
by
Andreas Jung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
regex free (tested)
parent
1a767309
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
6 deletions
+10
-6
lib/python/ZPublisher/Converters.py
lib/python/ZPublisher/Converters.py
+10
-6
No files found.
lib/python/ZPublisher/Converters.py
View file @
2e77beba
...
...
@@ -82,9 +82,9 @@
# attributions are listed in the accompanying credits file.
#
##############################################################################
__version__
=
'$Revision: 1.1
0
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.1
1
$'
[
11
:
-
2
]
import
re
gex
import
re
from
string
import
atoi
,
atol
,
atof
,
join
,
split
,
strip
from
types
import
ListType
,
TupleType
...
...
@@ -93,17 +93,21 @@ def field2string(v):
else
:
v
=
str
(
v
)
return
v
def
field2text
(
v
,
nl
=
re
gex
.
compile
(
'
\
r
\
n
\
|
\
n
\
r
'
).
search
):
def
field2text
(
v
,
nl
=
re
.
compile
(
'
\
r
\
n
\
|
\
n
\
r
'
).
search
):
if
hasattr
(
v
,
'read'
):
v
=
v
.
read
()
else
:
v
=
str
(
v
)
l
=
nl
(
v
)
if
l
<
0
:
return
v
mo
=
nl
(
v
)
if
mo
is
None
:
return
v
l
=
mo
.
start
(
0
)
r
=
[]
s
=
0
while
l
>=
s
:
r
.
append
(
v
[
s
:
l
])
s
=
l
+
2
l
=
nl
(
v
,
s
)
mo
=
nl
(
v
,
s
)
if
mo
is
None
:
l
=-
1
else
:
l
=
mo
.
start
(
0
)
r
.
append
(
v
[
s
:])
return
join
(
r
,
'
\
n
'
)
...
...
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