[Mailman-Users] Mailman moderator email links variable

Mark Sapiro mark at msapiro.net
Thu Jan 28 02:23:34 CET 2010


Tim Van Dyne wrote:

>Okay well I changed the emails successfully to the moderator email
>addresses and removed the mailto: because these are announce-only lists,
>and having real emails would defeat the purpose of the obscuring.
>The last thing I'm trying to figure out with this section is how to take
>away the italics tag on just the email addresses.  Basically
>"[/i]%(ownertext)s[i]" ...take it off then put it back on for emphasis
>of that text.
>
>The reverse is even acceptable, un-italicize everything, and then add
>[i]emails[/i] to make them stand out the inverse way.
>
>Any help with this is welcome.  I'm not seeing where this text
>formatting is occurring.
>
>The code as I have it now:
>
>class HTMLFormatter:
> 40     def GetMailmanFooter(self):
> 41         ownertext = COMMASPACE.join([Utils.ObscureEmail(a, 1)
> 42                                      for a in self.moderator])
>#changed to moderator from 'owner'
> 43         # Remove the .Format() when htmlformat conversion is done.
> 44         realname = self.real_name
> 45         hostname = self.host_name
> 46         listinfo_link  = Link(self.GetScriptURL('listinfo'),
>realname).Format()
> 47 #        owner_link = Link('mailto:' + self.GetOwnerEmail(),
>ownertext).Format()
> 48 #        innertext = _('%(listinfo_link)s list run by
>%(owner_link)s')
> 49         innertext = _('%(listinfo_link)s list run by
><b>%(ownertext)s</b>')
> 50         return Container(
> 51             '<hr>',
> 52             Address(


The Address class (defined in htmlformat.py) causes it's content to be
enclosed in <address>...</address> tags. These are what cause your
browser to italicize the contents. Because the italics (in your
browser but not necessarily all browsers) are caused by an <address>
tag, you can't turn them off and back on again with a </i>...<i>
sequence.

If what you want is to have the text italicized except for the
addresses, you can replace Address in line 52 with Italic and replace
<b>...</b> at line 49 with </i>...<i>.

If what you want is just the addresses italicized, you can eliminate
line 52 and replace <b>...</b> at line 49 with <i>...</i>.

There are other ways to make use of the htmlformat classes to generate
the desired HTML, but the above seems simplest to explain.


> 53                 Container(
> 54                    innertext,
> 55                     '<br>',
> 56                     Link(self.GetScriptURL('admin'),
> 57                          _('%(realname)s administrative
>interface')),
> 58                     _(' (requires authorization)'),
> 59                     '<br>',
> 60                     Link(Utils.ScriptURL('listinfo'),
> 61                          _('Overview of all %(hostname)s mailing
>lists')),
> 62                     '<p>', MailmanLogo()))).Format()

-- 
Mark Sapiro <mark at msapiro.net>        The highway is for gamblers,
San Francisco Bay Area, California    better use your sense - B. Dylan



More information about the Mailman-Users mailing list