Recomp single py module - htmformat.py

Asked by Brian McCarthy

I would like to add a general style sheet (actually, a few) to a site's mailman interface. I can copy over and update all the html files in the template/en directory, and that gets me a little bit of the way, but some of the admin and user pages are not using templates.

I believe I can make a few changes to Mailman/htmlformat.py to put in the style sheet references inside of the <HEAD> section, but this install is inside of cpanel and I do not know python (but I am a programmer) so I'm not sure what the magic is to generate the pyc (pre-compiled - correct??)

I am in the 2.1 stream (not recommended that I install the 3.n stream because of cpanel)

Thanks,

Brian

Question information

Language:
English Edit question
Status:
Solved
For:
GNU Mailman Edit question
Assignee:
No assignee Edit question
Solved by:
Brian McCarthy
Solved:
Last query:
Last reply:
Revision history for this message
Mark Sapiro (msapiro) said :
#1

Mailman 3 is not yet ready for production use in any case, cPanel or no.

Regarding changing htmlformat.py, that is the correct place to do this. All you need do is edit htmlformat.py. It is always safest to restart Mailman after making any changes to any .py files, although in this case, it isn't strictly necessary because htmlformat.py is used only by the web CGIs and not by the Mailman qrunners.

When python imports a module such as htmlformat, it looks at the htmlformat.py* files. if the .pyc is as new or newer than the .py and was compiled with the same python version, it uses it. Otherwise, it loads and compiles the .py file and if it has permission, it writes the .pyc. Thus, the first time you access the Mailman web interface after changing htmlformat.py, it will be automatically recompiled and htmlformat.pyc updated.

Revision history for this message
Brian McCarthy (bmccarthy) said :
#2

The on-the-fly recomp is what I didn't understand.

I've got the changes made and I'm good to go.

I do wish however, that I could customize it per domain (under cpanel, I have one install of mailman).

However, problem solved.