Re: [Mailman-Users] Customizing main listinfo page?

2002-01-08 Thread Nigel Kersten

Just in case anyone wants to do what I asked about doing, which is to
customise the listinfo page to include stuff in the HEAD/HEAD section,
mainly stylesheets and javascript, the easiest way I found appeared to be to
change the creation of 'doc' in /usr/local/mailman/Mailman/Cgi/listinfo.py,
from
 
doc= Document()

To

doc = HeadlessDocument()


And then manually inserting all the HEAD stuff before the table data gets
written to 'doc'.



Nigel







On 7/1/02 2:04 PM, Nigel Kersten [EMAIL PROTECTED] wrote:

 Ok, so it's apparently ok for me to customise this page, and I'll get warned
 when I upgrade.
 
 Now for another question... ;) that possibly belongs more on the Dev list,
 but here goes...
 
 
 I'd like to merge my listinfo page into the rest of my site, so I'd like to
 use style sheets... My only problem is that I can't see how on earth I can
 insert anything before the /HEAD tag in the Document() call in the
 listinfo page... ?
 
 The relevant bit seems to be in htmlformat.py, here...
 
 class Document(Container):
   title = None
 
   def SetTitle(self, title):
   self.title = title
  
   def Format(self, indent=0, **kws):
   tab = ' ' * indent
   output = ['Content-type: text/html',
 '',
 tab,
 'HTML',
 'HEAD'
 ]
   if self.title:
   output.append('%sTITLE%s/TITLE' % (tab, self.title))
   output.append('%s/HEAD' % tab)
   output.append('%sBODY' % tab)
 
 
 
 I guess I could just hack it and add something to insert data before this,
 but this definitely seems like bad form to go messing with this module... ?
 
 
 
 Nigel


--
N i g e l   K e r s t e n |  College of Fine Arts,
[Systems Administrator]   |  Uni.of.NSW.Sydney.Australia.
[EMAIL PROTECTED]|  ph.9385 0672:fax.9385 0624

It's like a jungle sometimes, it makes me wonder,
how I keep from going under - Grandmaster Flash.


--
Mailman-Users maillist  -  [EMAIL PROTECTED]
http://mail.python.org/mailman/listinfo/mailman-users



Re: [Mailman-Users] Customizing main listinfo page?

2002-01-06 Thread Nigel Kersten

Ok, so it's apparently ok for me to customise this page, and I'll get warned
when I upgrade.

Now for another question... ;) that possibly belongs more on the Dev list,
but here goes...


I'd like to merge my listinfo page into the rest of my site, so I'd like to
use style sheets... My only problem is that I can't see how on earth I can
insert anything before the /HEAD tag in the Document() call in the
listinfo page... ?

The relevant bit seems to be in htmlformat.py, here...

class Document(Container):
title = None

def SetTitle(self, title):
self.title = title
   
def Format(self, indent=0, **kws):
tab = ' ' * indent
output = ['Content-type: text/html',
  '',
  tab,
  'HTML',
  'HEAD'
  ]
if self.title:
output.append('%sTITLE%s/TITLE' % (tab, self.title))
output.append('%s/HEAD' % tab)
output.append('%sBODY' % tab)



I guess I could just hack it and add something to insert data before this,
but this definitely seems like bad form to go messing with this module... ?



Nigel





On 7/1/02 1:13 PM, Nigel Kersten [EMAIL PROTECTED] wrote:

 (Disclaimer: have tried searching the archives, but 'listinfo' is a
 singularly unproductive search term, due to the footer... :)
 
 
 I'd like to customize the main listinfo page, the one showing all the lists
 on the host. I don't really know python (yet) but I can easily see what the
 listinfo.py file is doing, and if I make changes there, they get reflected
 in the page.
 
 This doesn't seem like the direction I want to take, as it seems likely that
 future upgrades of Mailman may wipe out my changes, so I guess I want to
 copy the listinfo.py script to a new file and start again.
 
 My question is, how on earth does this work? When I go to the URL
 http://www.mysite.com/mailman/listinfo that is actually referring to the
 /usr/local/mailman/cgi-bin/listinfo binary, right?
 
 Is this a compiled python file? Like .pyc files?
 
 The listinfo.pyc and the listinfo file in the cgi-bin aren't the same file
 from their sizes, so I'm just wondering how this works, I assume the second
 file calls the listinfo.py file somehow... ?
 
 Anyway, I'm about to go searching through the python.org site to get a
 better grip on all this, but I guess I was just wondering if anyone had any
 simple suggestions for coming up with an alternative listinfo page...
 
 
 Cheers,
 
 
 nigel


--
N i g e l   K e r s t e n |  College of Fine Arts,
[Systems Administrator]   |  Uni.of.NSW.Sydney.Australia.
[EMAIL PROTECTED]|  ph.9385 0672:fax.9385 0624

It's like a jungle sometimes, it makes me wonder,
how I keep from going under - Grandmaster Flash.


--
Mailman-Users maillist  -  [EMAIL PROTECTED]
http://mail.python.org/mailman/listinfo/mailman-users