[Mailman-Users] Re: Is there any way to get the date???

Paul H Byerly paul at thcwd.com
Fri Oct 3 05:05:23 CEST 2003


Todd offered a patch to add dates to archive pages:
>Anyway, have someone that knows python and mailman better than I look this
>over before you use it for anything important.

      My server only has announcement lists I control (until this weekend) 
so I backed everything up and plunged in.  Worked beautifully - thanks much!

>There's only two files I needed to modify, Mailman/Archiver/HyperArch.py,
>and templates/en/archidxentry.html.

      Okay, now that I've seen it, it's an "of course".  Don't know if I'd 
ever have gotten there myself.

>One thing I can see being a problem is that lines will get real long so 
>the formatting in archidxentry.html might
>need to be played with to keep it readable.

      I've set the date to a couple of sized smaller, and that helps (see 
below).  If I can cut off the year and time zone it would fit nicely.  It 
would also be nice to have a truncate feature for the subject.  Things to 
put on my very long list.


>=====================================================================
>- --- Mailman/Archiver/HyperArch.py~    Sun Sep 28 20:21:28 2003
>+++ Mailman/Archiver/HyperArch.py       Sun Sep 28 20:22:43 2003
>@@ -965,16 +965,19 @@
>      def write_index_entry(self, article):
>          subject = self.get_header("subject", article)
>          author = self.get_header("author", article)
>+        datestr = i18n.ctime(int(article.date))
>          if mm_cfg.ARCHIVER_OBSCURES_EMAILADDRS:
>              author = re.sub('@', _(' at '), author)
>          subject = CGIescape(subject, self.lang)
>          author = CGIescape(author, self.lang)
>+        datestr = CGIescape(datestr, self.lang)
>
>          d = {
>              'filename': urllib.quote(article.filename),
>              'subject':  subject,
>              'sequence': article.sequence,
>- -            'author':   author
>+            'author':   author,
>+            'datestr':  datestr
>          }
>          print quick_maketext(
>              'archidxentry.html', d,
>- --- templates/en/archidxentry.html~   Mon Sep 22 15:46:26 2003
>+++ templates/en/archidxentry.html      Sun Sep 28 20:19:22 2003
>@@ -1,4 +1,4 @@
>  <LI><A HREF="%(filename)s">%(subject)s
>  </A><A NAME="%(sequence)i">&nbsp;</A>
>- -<I>%(author)s
>+<I>%(author)s (%(datestr)s)
>  </I>

      My formatting for archidxentry.html:

      </A><A NAME="%(sequence)i">&nbsp;</A>
- -  <I>%(author)s
+   <I>%(author)s </I>&nbsp;&nbsp;<small><small>(%(datestr)s)</small></small>



<>< Paul 





More information about the Mailman-Users mailing list