[reportlab-users] platypus.para module

Robin Becker reportlab-users@reportlab.com
Thu, 10 Apr 2003 08:50:00 +0100


In article <017001c2fefa$66d74be0$03000000@over>, Ury Marshak <urym@two-
bytes.com> writes
>> to the one in reportlab\platypus\para.py, not the 'default' and
>> older one in reportlab\platypus\paragraph.py. 
>
>On a somewhat [not really ;)] relevant note: I was making a patch
>to the old 'default' paragraph.py to support underlining (with the
><u> </u> tags) and found that on my system the paragraph.py
>module was failing to import the accelerator with
>
>    from _rl_accel import _sameFrag
>
>line. It started working when I changed it to be
>
>    from reportlab.lib._rl_accel import _sameFrag
>
>(this is using 1.17).
>
>Ury
.... the original intention is that _rl_accel should not be required. My
version of paragraph has

try:
        from _rl_accel import _sameFrag
except:
        def _sameFrag(f,g):
                'returns 1 if two ParaFrags map out the same'
                if hasattr(f,'cbDefn') or hasattr(g,'cbDefn'): return 0
                for a in ('fontName', 'fontSize', 'textColor', 'rise'):
                        if getattr(f,a)!=getattr(g,a): return 0
                return 1

any attempt to change to an unconditional import should be avoided.
-- 
Robin Becker