[Spambayes-checkins] spambayes/Outlook2000/sandbox mapi_driver.py,
1.4, 1.5
Mark Hammond
mhammond at users.sourceforge.net
Sun Aug 31 23:36:36 EDT 2003
Update of /cvsroot/spambayes/spambayes/Outlook2000/sandbox
In directory sc8-pr-cvs1:/tmp/cvs-serv6348
Modified Files:
mapi_driver.py
Log Message:
save and restore the cwd when logging onto mapi
Index: mapi_driver.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/Outlook2000/sandbox/mapi_driver.py,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** mapi_driver.py 25 Aug 2003 04:19:37 -0000 1.4
--- mapi_driver.py 1 Sep 2003 05:36:34 -0000 1.5
***************
*** 2,5 ****
--- 2,6 ----
# Utilities for our sandbox
+ import os
import pythoncom
from win32com.mapi import mapi, mapiutil
***************
*** 10,13 ****
--- 11,15 ----
class MAPIDriver:
def __init__(self, read_only = False):
+ old_cwd = os.getcwd()
mapi.MAPIInitialize(None)
logonFlags = (mapi.MAPI_NO_MAIL |
***************
*** 20,23 ****
--- 22,26 ----
self.mapi_flags = mapi.MAPI_DEFERRED_ERRORS | mapi.MAPI_BEST_ACCESS
self.outlook = None
+ os.chdir(old_cwd)
def _GetMAPIFlags(self, mapi_flags = None):
More information about the Spambayes-checkins
mailing list