move com_error to system.windows.api
git-svn-id: svn://svn.cy55.de/Zope3/src/cybertools/trunk@2536 fd906abe-77d9-0310-91a1-e0d9ade77398
This commit is contained in:
parent
acc93c09b5
commit
9826f31cc2
4 changed files with 12 additions and 6 deletions
|
@ -27,7 +27,7 @@ from email import MIMEMultipart
|
||||||
|
|
||||||
from zope.interface import implements
|
from zope.interface import implements
|
||||||
from twisted.internet import defer
|
from twisted.internet import defer
|
||||||
from pywintypes import com_error
|
#from pywintypes import com_error
|
||||||
#The watsup import is needed as soon as we start handling the Outlook Pop-Up
|
#The watsup import is needed as soon as we start handling the Outlook Pop-Up
|
||||||
#again
|
#again
|
||||||
#This should also be integrated within the wrapper-api for doctests
|
#This should also be integrated within the wrapper-api for doctests
|
||||||
|
@ -114,7 +114,7 @@ class OutlookCrawler(MailCrawler):
|
||||||
try:
|
try:
|
||||||
if isinstance(getattr(mail, key), (int, str, unicode)):
|
if isinstance(getattr(mail, key), (int, str, unicode)):
|
||||||
self.keys.append(key)
|
self.keys.append(key)
|
||||||
except com_error:
|
except api.com_error:
|
||||||
pass
|
pass
|
||||||
record = {}
|
record = {}
|
||||||
for key in self.keys:
|
for key in self.keys:
|
||||||
|
|
|
@ -46,4 +46,4 @@ the twisted reactor first.
|
||||||
Namespace MAPI retrieved
|
Namespace MAPI retrieved
|
||||||
retrieving Outlook default folder
|
retrieving Outlook default folder
|
||||||
collecting Mails from folder
|
collecting Mails from folder
|
||||||
Job 00001 completed; result: [...];
|
Job 00001 completed; result: [<...MailResource...>, <...MailResource...>, <...MailResource...>];
|
||||||
|
|
|
@ -23,16 +23,17 @@ $Id$
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def setup(config):
|
def setup(config):
|
||||||
global client, ctypes, win32api, win32process, win32con
|
global client, ctypes, win32api, win32process, win32con, com_error
|
||||||
if config.system.winapi == 'testing':
|
if config.system.winapi == 'testing':
|
||||||
from cybertools.agent.testing.winapi import \
|
from cybertools.agent.testing.winapi import \
|
||||||
client, ctypes, win32api, win32process, win32con
|
client, ctypes, win32api, win32process, win32con, com_error
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
from win32com import client
|
from win32com import client
|
||||||
import ctypes
|
import ctypes
|
||||||
import win32api, win32process, win32con
|
import win32api, win32process, win32con
|
||||||
|
from pywintypes import com_error
|
||||||
except ImportError:
|
except ImportError:
|
||||||
from cybertools.agent.testing.winapi import \
|
from cybertools.agent.testing.winapi import \
|
||||||
client, ctypes, win32api, win32process, win32con
|
client, ctypes, win32api, win32process, win32con, com_error
|
||||||
|
|
||||||
|
|
|
@ -24,6 +24,11 @@ $Id$
|
||||||
|
|
||||||
client = ctypes = win32api = win32process = win32con = None
|
client = ctypes = win32api = win32process = win32con = None
|
||||||
|
|
||||||
|
|
||||||
|
class com_error(Exception):
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
class Mail(object):
|
class Mail(object):
|
||||||
|
|
||||||
#this is just a guess what a Outlook Mail Object Probably returns
|
#this is just a guess what a Outlook Mail Object Probably returns
|
||||||
|
|
Loading…
Add table
Reference in a new issue