[Spambayes-checkins] spambayes/Outlook2000/sandbox dump_profiles.py, NONE, 1.1

Mark Hammond mhammond at users.sourceforge.net
Sun Jun 15 22:51:32 EDT 2003


Update of /cvsroot/spambayes/spambayes/Outlook2000/sandbox
In directory sc8-pr-cvs1:/tmp/cvs-serv17452

Added Files:
	dump_profiles.py 
Log Message:
Little bit of test code worth saving for later when everyone complains
the profile detection code is wrong


--- NEW FILE: dump_profiles.py ---

from win32com.client import Dispatch
from win32com.mapi import mapi, exchange
from win32com.mapi.mapitags import *

mapi.MAPIInitialize(None)
logonFlags = mapi.MAPI_NO_MAIL | mapi.MAPI_EXTENDED
session = mapi.MAPILogonEx(0, None, None, logonFlags)

MAPI_SUBSYSTEM = 39

restriction = mapi.RES_PROPERTY, (mapi.RELOP_EQ, PR_RESOURCE_TYPE, (PR_RESOURCE_TYPE,MAPI_SUBSYSTEM))
table = session.GetStatusTable(0)
rows = mapi.HrQueryAllRows(table,
                            (PR_DISPLAY_NAME_A,),   # columns to retrieve
                            restriction,     # only these rows
                            None,            # any sort order is fine
                            0)               # any # of results is fine
assert len(rows)==1, "Should be exactly one row"
(tag, val), = rows[0]
print "Profile name:", val





More information about the Spambayes-checkins mailing list