Hi Glenn,
As far as we know the code behaves identically in Pythons 2.7, 3.3 and
3.4; certainly the user guide generates and all the tests run.
It looks like we managed to document a very, very old pattern in the
user guide and to give a completely misleading explanation of how to
set up the styles, and somehow it has survived about 13-14 years. My
apologies for this. We're warming up for a release in November and
need to make a pass through the whole user guide.
If we were redoing things now we would use a metaclass-like pattern
similar to Django's models or forms, but that didn't exist in Python
1.4 or whatever we were on at the time; reportlab/lib/styles has our
own handrolled version of this, designed for speed rather than
elegance. I'm not sure why we showed an example like this.
The intended use is for you to do this:
mystyle = ParagraphStyle(key1=value1, key2=value2, etc...)
...and just keep a style instance around. I don't think you would
want to create your own subclass for anything I can think of. We
support inheritance by allowing a parent attribute e.g.
styBase = ParagraphStyle(fontName="myfont", fontSize=10)
styBold = ParagraphStyle(parent=styBase, fontName="myBoldFont")
..
That way, all paragraph styles will be initialised with every
attribute currently supported.
- Andy
> _______________________________________________
> reportlab-users mailing list
>
reportl...@lists2.reportlab.com
>
https://pairlist2.pair.net/mailman/listinfo/reportlab-users
>
--
Andy Robinson
Managing Director
ReportLab Europe Ltd.
Thornton House, Thornton Road, Wimbledon, London SW19 4NG, UK
Tel
+44-20-8405-6420
_______________________________________________
reportlab-users mailing list
reportl...@lists2.reportlab.com
https://pairlist2.pair.net/mailman/listinfo/reportlab-users