Commit c71953eb authored by Jim Fulton's avatar Jim Fulton

paragraph_divider needs to be a regular (thread-unsafe) regex

since it gets passed to ts_regex.split, which is thread-safe
and wants to use regs.
parent 92d9f9e7
...@@ -170,7 +170,7 @@ Special symbology is used to indicate special constructs: ...@@ -170,7 +170,7 @@ Special symbology is used to indicate special constructs:
Together with the previous rule this allows easy coding of references or Together with the previous rule this allows easy coding of references or
end notes. end notes.
$Id: StructuredText.py,v 1.20 1999/07/21 13:33:59 jim Exp $''' $Id: StructuredText.py,v 1.21 1999/08/02 13:26:52 jim Exp $'''
# Copyright # Copyright
# #
# Copyright 1996 Digital Creations, L.C., 910 Princess Anne # Copyright 1996 Digital Creations, L.C., 910 Princess Anne
...@@ -222,6 +222,11 @@ $Id: StructuredText.py,v 1.20 1999/07/21 13:33:59 jim Exp $''' ...@@ -222,6 +222,11 @@ $Id: StructuredText.py,v 1.20 1999/07/21 13:33:59 jim Exp $'''
# (540) 371-6909 # (540) 371-6909
# #
# $Log: StructuredText.py,v $ # $Log: StructuredText.py,v $
# Revision 1.21 1999/08/02 13:26:52 jim
# paragraph_divider needs to be a regular (thread-unsafe) regex
# since it gets passed to ts_regex.split, which is thread-safe
# and wants to use regs.
#
# Revision 1.20 1999/07/21 13:33:59 jim # Revision 1.20 1999/07/21 13:33:59 jim
# untabified. # untabified.
# #
...@@ -333,13 +338,13 @@ $Id: StructuredText.py,v 1.20 1999/07/21 13:33:59 jim Exp $''' ...@@ -333,13 +338,13 @@ $Id: StructuredText.py,v 1.20 1999/07/21 13:33:59 jim Exp $'''
# #
# #
# #
import ts_regex import ts_regex, regex
from ts_regex import gsub from ts_regex import gsub
from string import split, join, strip, find from string import split, join, strip, find
indent_tab =ts_regex.compile('\(\n\|^\)\( *\)\t') indent_tab =ts_regex.compile('\(\n\|^\)\( *\)\t')
indent_space=ts_regex.compile('\n\( *\)') indent_space=ts_regex.compile('\n\( *\)')
paragraph_divider=ts_regex.compile('\(\n *\)+\n') paragraph_divider=regex.compile('\(\n *\)+\n')
def untabify(aString): def untabify(aString):
'''\ '''\
...@@ -482,7 +487,8 @@ class StructuredText: ...@@ -482,7 +487,8 @@ class StructuredText:
aStructuredString) aStructuredString)
self.level=level self.level=level
paragraphs=ts_regex.split(untabify(aStructuredString),paragraph_divider) paragraphs=ts_regex.split(untabify(aStructuredString),
paragraph_divider)
paragraphs=map(indent_level,paragraphs) paragraphs=map(indent_level,paragraphs)
self.structure=structure(paragraphs) self.structure=structure(paragraphs)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment