CVS: tmda/TMDA Util.py,1.115,1.116

"Jason R. Mastaler" <[email protected]> Mon, 01 Mar 2004 18:57:29 -0800
Newsgroups gmane.mail.spam.tmda.cvs
Message-ID <[email protected]>
Update of /cvsroot/tmda/tmda/TMDA
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13982/TMDA

Modified Files:
	Util.py 
Log Message:
minor changes -- change occurrences of 0 to False, and have
make_date() use email.Utils.formatdate() verbatim for better platform
compatibility.


Index: Util.py
===================================================================
RCS file: /cvsroot/tmda/tmda/TMDA/Util.py,v
retrieving revision 1.115
retrieving revision 1.116
diff -u -r1.115 -r1.116
--- Util.py	18 Feb 2004 21:37:58 -0000	1.115
+++ Util.py	2 Mar 2004 02:57:27 -0000	1.116
@@ -292,17 +292,16 @@
 
 
 def make_date(timesecs=None):
-    """Return an RFC 2822 compliant Date: string.  e.g,
+    """Return an RFC 2822 compliant Date string relative to the local
+    timezone.  e.g,
 
-    Thu, 24 Apr 2003 10:15:15 +1200 (NZST)
+    Tue, 02 Mar 2004 15:55:05 +1300
 
     timesecs is optional, and if not given, the current time is used.
     """
     if timesecs is None:
         timesecs = time.time()
-    tzname = time.tzname[time.localtime(timesecs)[-1]]
-    basedate = email.Utils.formatdate(timesecs, localtime=1)
-    return '%s (%s)' % (basedate, tzname)
+    return email.Utils.formatdate(timesecs, localtime=True)
 
 
 def file_to_dict(file, dict):
@@ -508,7 +507,7 @@
     return rp
 
 
-def msg_from_file(fp, strict=0):
+def msg_from_file(fp, strict=False):
     """Read a file and parse its contents into a Message object model.
     Replacement for email.message_from_file().
     
@@ -523,7 +522,7 @@
     return msg
 
 
-def msg_as_string(msg, maxheaderlen=0, mangle_from_=0, unixfrom=0):
+def msg_as_string(msg, maxheaderlen=False, mangle_from_=False, unixfrom=False):
     """A more flexible replacement for Message.as_string().  The default
     is a textual representation of the message where the headers are
     not wrapped, From is not escaped, and a leading From_ line is not
@@ -750,7 +749,7 @@
         return 1
 
 
-def pickleit(object, file, bin=0):
+def pickleit(object, file, bin=False):
     """Store object in a pickle file.
     Optional bin specifies whether to use binary or text pickle format."""
     tempfile.tempdir = os.path.dirname(file)