diff python/test.py @ 299:1ddc61fd6189

fix pst_binary in python interface
author Carl Byington <carl@five-ten-sg.com>
date Sun, 14 Aug 2011 19:58:47 -0700
parents 268458c79e9b
children
line wrap: on
line diff
--- a/python/test.py	Tue Aug 02 17:02:39 2011 -0700
+++ b/python/test.py	Sun Aug 14 19:58:47 2011 -0700
@@ -7,7 +7,7 @@
 
 for i in range(1,len(sys.argv)):
     print "try file %s" % (sys.argv[i])
-    pst = _libpst.pst(sys.argv[i])
+    pst = _libpst.pst(sys.argv[i], "")
     topf = pst.pst_getTopOfFolders()
 
     print pst.pst_rfc2425_datetime_format(ft)
@@ -27,6 +27,8 @@
                     if (em.messageid.str):
                         print "message id is <%s>" % (em.messageid.str)
                     subj = item.subject;
+                    rtf  = em.rtf_compressed;
+                    if rtf and (len(rtf) > 0): print "rtf compressed size", len(rtf)
                     if (subj and subj.str):
                         was = subj.is_utf8;
                         pst.pst_convert_utf8(item, subj)
@@ -38,13 +40,13 @@
                     #if (body.str):
                     #    print "message body is %s" % (body.str)
                     att = item.attach
+                    att = None
                     while (att):
-                        attid   = att.i_id
-                        print "attachment id %d" % (attid)
-                        att1 = att.filename1
-                        att2 = att.filename2
-                        print "attachment file name short '%s' long '%s'" % (att1.str, att2.str)
-                        if (0):
+                        attid = att.i_id
+                        att1  = att.filename1
+                        att2  = att.filename2
+                        print "attachment id %d file name short '%s' long '%s'" % (attid, att1.str, att2.str)
+                        if (1):
                             attdata = pst.pst_attach_to_mem(att)
                             if (attdata):
                                 print "data size %d" % (len(attdata))
@@ -54,7 +56,7 @@
                                 si = pst.pst_attach_to_file_base64(att, f)
                                 pst.ppst_close_file(f)
                                 print "wrote %d bytes in %s" % (si, att2.str)
-                        if (1):
+                        if (0):
                             f = pst.ppst_open_file(att2.str, 'w')
                             if (f):
                                 si = pst.pst_attach_to_file(att, f)