Mercurial > libpst
comparison python/test.py @ 204:268458c79e9b
more cleanup of the shared library interface, but still not fully thread safe
author | Carl Byington <carl@five-ten-sg.com> |
---|---|
date | Sat, 06 Jun 2009 11:39:02 -0700 |
parents | ffd1503a7530 |
children | 1ddc61fd6189 |
comparison
equal
deleted
inserted
replaced
203:9fb600ef4e03 | 204:268458c79e9b |
---|---|
1 import _libpst, sys | 1 import _libpst, sys |
2 | |
3 print _libpst.__dict__ | |
4 exit | |
5 | 2 |
6 ft = _libpst.FILETIME() | 3 ft = _libpst.FILETIME() |
7 ft.dwLowDateTime = 0 | 4 ft.dwLowDateTime = 0 |
8 ft.dwHighDateTime = 1 | 5 ft.dwHighDateTime = 1 |
9 | 6 |
26 print "default charset %s" % (pst.pst_default_charset(item)) | 23 print "default charset %s" % (pst.pst_default_charset(item)) |
27 ft = em.arrival_date | 24 ft = em.arrival_date |
28 if (ft): | 25 if (ft): |
29 print "message arrived at %s" % (pst.pst_rfc2425_datetime_format(ft)) | 26 print "message arrived at %s" % (pst.pst_rfc2425_datetime_format(ft)) |
30 if (em.messageid.str): | 27 if (em.messageid.str): |
31 print "message id is |%s|" % (em.messageid.str) | 28 print "message id is <%s>" % (em.messageid.str) |
32 subj = item.subject; | 29 subj = item.subject; |
33 if (subj and subj.str): | 30 if (subj and subj.str): |
34 was = subj.is_utf8; | 31 was = subj.is_utf8; |
35 pst.pst_convert_utf8(item, subj) | 32 pst.pst_convert_utf8(item, subj) |
36 now = subj.is_utf8; | 33 now = subj.is_utf8; |
44 while (att): | 41 while (att): |
45 attid = att.i_id | 42 attid = att.i_id |
46 print "attachment id %d" % (attid) | 43 print "attachment id %d" % (attid) |
47 att1 = att.filename1 | 44 att1 = att.filename1 |
48 att2 = att.filename2 | 45 att2 = att.filename2 |
49 print "attachment file name %s %s" % (att1.str, att2.str) | 46 print "attachment file name short '%s' long '%s'" % (att1.str, att2.str) |
50 if (0): | 47 if (0): |
51 attdata = pst.pst_attach_to_mem(att) | 48 attdata = pst.pst_attach_to_mem(att) |
52 if (attdata): | 49 if (attdata): |
53 print "data size %d" % (len(attdata)) | 50 print "data size %d" % (len(attdata)) |
54 if (0): | 51 if (0): |