Calendar module: HTMLCalendar overrides style sheet settings

Sibylle Koczian nulla.epistola at web.de
Thu Mar 26 20:39:54 CET 2009


Hello,

I want to create a calendar with special text and background color for
holidays and some other dates. This is for printing, but a HTML file
seems a good choice, independent of changing text processing software
and easier to code with Python than a script which fills in a Word or
OpenOffice template.

So I looked into the calendar module and made a LocalHTMLCalendar
subclass. Putting in additional style classes for "my" dates wasn't
difficult, but there is one thing I don't like at all: the methods
formatmonth() and formatyear() both return tables with explicit and ugly
formatting:

<table border="0" cellpadding="0" cellspacing="0" class="month">

and the same for class="year". This overrides the settings I make in the
style sheet.

Of course I can overwrite these methods, but why do it like this? The
output is made for use with a style sheet, so why use direct formatting
at this point?

Thanks for explanations and advice,
Sibylle



More information about the Python-list mailing list