equal
deleted
inserted
replaced
1 #copyright ReportLab Inc. 2000 |
1 #copyright ReportLab Inc. 2000 |
2 #see license.txt for license details |
2 #see license.txt for license details |
3 #history http://cvs.sourceforge.net/cgi-bin/cvsweb.cgi/reportlab/platypus/paraparser.py?cvsroot=reportlab |
3 #history http://cvs.sourceforge.net/cgi-bin/cvsweb.cgi/reportlab/platypus/paraparser.py?cvsroot=reportlab |
4 #$Header: /tmp/reportlab/reportlab/platypus/paraparser.py,v 1.32 2000/11/23 16:54:48 rgbecker Exp $ |
4 #$Header: /tmp/reportlab/reportlab/platypus/paraparser.py,v 1.33 2000/11/29 17:28:50 rgbecker Exp $ |
5 __version__=''' $Id: paraparser.py,v 1.32 2000/11/23 16:54:48 rgbecker Exp $ ''' |
5 __version__=''' $Id: paraparser.py,v 1.33 2000/11/29 17:28:50 rgbecker Exp $ ''' |
6 import string |
6 import string |
7 import re |
7 import re |
8 from types import TupleType |
8 from types import TupleType |
9 import sys |
9 import sys |
10 import os |
10 import os |
11 import copy |
11 import copy |
12 |
12 |
13 import reportlab.lib.sequencer |
13 import reportlab.lib.sequencer |
|
14 from reportlab.lib.abag import ABag |
14 #try: |
15 #try: |
15 # from xml.parsers import xmllib |
16 # from xml.parsers import xmllib |
16 # _xmllib_newStyle = 1 |
17 # _xmllib_newStyle = 1 |
17 try: |
18 try: |
18 from reportlab.lib import xmllib |
19 from reportlab.lib import xmllib |
147 'xi':'x', |
148 'xi':'x', |
148 'zeta':'z' |
149 'zeta':'z' |
149 } |
150 } |
150 |
151 |
151 #------------------------------------------------------------------------ |
152 #------------------------------------------------------------------------ |
152 class ParaFrag: |
153 class ParaFrag(ABag): |
153 """class ParaFrag contains the intermediate representation of string |
154 """class ParaFrag contains the intermediate representation of string |
154 segments as they are being parsed by the XMLParser. |
155 segments as they are being parsed by the XMLParser. |
155 """ |
156 """ |
156 def __init__(self,**attr): |
|
157 for k,v in attr.items(): |
|
158 setattr(self,k,v) |
|
159 |
|
160 def clone(self,**attr): |
|
161 n = apply(ParaFrag,(),self.__dict__) |
|
162 if attr != {}: apply(ParaFrag.__init__,(n,),attr) |
|
163 return n |
|
164 |
157 |
165 #------------------------------------------------------------------ |
158 #------------------------------------------------------------------ |
166 # !!! NOTE !!! THIS TEXT IS NOW REPLICATED IN PARAGRAPH.PY !!! |
159 # !!! NOTE !!! THIS TEXT IS NOW REPLICATED IN PARAGRAPH.PY !!! |
167 # The ParaFormatter will be able to format the following xml |
160 # The ParaFormatter will be able to format the following xml |
168 # tags: |
161 # tags: |