Re: [Mailman-Users] Mailman moderator email links variable
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( 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()
-----Original Message----- From: Tim Van Dyne Sent: Wednesday, January 27, 2010 9:06 AM To: 'mailman-users@python.org' Subject: Mailman moderator email links variable
After wading through the configs & google for a few hours I figure I'd just ask. Is there a variable that I can use to display moderator email address links.
The same way owner_link is defined in HTMLFormatter.py: owner_link = Link('mailto:' + self.GetOwnerEmail(), ownertext).Format()
The goal is to change the line in HTMLFormatter.py that displays the site owner email in the footer: innertext = _('%(listinfo_link)s list run by %(owner_link)s') To show moderator emails instead...
-Tim-
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@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
Mark Sapiro wrote:
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>.
Ooops. This is wrong because the Italic class generates an <em> tag, not an <i> tag, so if you replace Address with Italic, you need to use </em>...<em> to turn it off and on.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
participants (2)
-
Mark Sapiro -
Tim Van Dyne