Update of /cvsroot/tmda/tmda/contrib/cgi
In directory sc8-pr-cvs1:/tmp/cvs-serv17114

Modified Files:
        Pending.py 
Log Message:
Calculate date instead of trying to pull and decode it from the e-mail headers.


Index: Pending.py
===================================================================
RCS file: /cvsroot/tmda/tmda/contrib/cgi/Pending.py,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- Pending.py  14 Feb 2003 19:01:51 -0000      1.13
+++ Pending.py  18 Feb 2003 21:23:48 -0000      1.14
@@ -234,13 +234,11 @@
       MsgSize = CgiUtil.Size(MsgObj.msgobj)
   
       # Find preferred date
-      try:
-        Temp = \
-re.compile("\d+ [a-zA-Z]+ \d+ \d+:\d\d:\d\d").search(MsgObj.msgobj.get("date"))
-        Date = time.strptime(Temp.group(), "%d %b %Y %H:%M:%S")
-        Date = time.strftime(Defaults.CGI_DATE_FORMAT, Date)
-      except (TypeError, ValueError, AttributeError):
-        Date = "None"
+      Date = time.strftime \
+      (
+        Defaults.CGI_DATE_FORMAT,
+        time.localtime(int(MsgObj.msgid.split('.')[0]))
+      )
   
       # Subject:
       if not MsgObj.msgobj["subject"]:

_______________________________________
tmda-cvs mailing list
http://tmda.net/lists/listinfo/tmda-cvs

Reply via email to