[Collab-qa-commits] r1171 - upload-history

filippo at alioth.debian.org filippo at alioth.debian.org
Thu Aug 28 14:23:22 UTC 2008


Author: filippo
Date: 2008-08-28 14:23:21 +0000 (Thu, 28 Aug 2008)
New Revision: 1171

Modified:
   upload-history/munge_ddc.py
Log:
actually use outfile when outputting

Modified: upload-history/munge_ddc.py
===================================================================
--- upload-history/munge_ddc.py	2008-08-28 12:49:10 UTC (rev 1170)
+++ upload-history/munge_ddc.py	2008-08-28 14:23:21 UTC (rev 1171)
@@ -82,8 +82,6 @@
 def munge_ddc(mb_file, outfile=sys.stdout):
     """ Scan given mb_file as a unix mailbox and extract upload informations """
 
-    #outfile = file(mb_file + ".csv", 'w')
-    
     mb = mailbox.PortableUnixMailbox(file(mb_file), factory=email.message_from_file)
 
     if os.path.exists(msgid_cache) and not os.environ.has_key('NO_CACHE'):
@@ -152,12 +150,12 @@
         # finally output fields
         for field in output_fields:
             try:
-                print "%s: %s" % (field, c[field])
+                outfile.write("%s: %s" % (field, str(c[field]).strip('\n')))
             except KeyError:
-                print "%s: N/A" % field
+                outfile.write("%s: N/A" % field)
 
         # separate different packages
-        print
+        outfile.write("\n")
 
     if not os.environ.has_key('NO_CACHE'):
         cPickle.dump(m_cache, open(msgid_cache, "w"), 2)




More information about the Collab-qa-commits mailing list