diff --git a/agent/crawl/base.py b/agent/crawl/base.py index b9143aa..ca66266 100644 --- a/agent/crawl/base.py +++ b/agent/crawl/base.py @@ -36,11 +36,8 @@ class Crawler(QueueableAgent): implements(ICrawler) - params = {} - def __init__(self, master, params={}): super(Crawler, self).__init__(master) - self.params = params def process(self): return self.collect() diff --git a/agent/crawl/outlook.py b/agent/crawl/outlook.py index 1027347..2bdc164 100644 --- a/agent/crawl/outlook.py +++ b/agent/crawl/outlook.py @@ -98,7 +98,7 @@ class OutlookCrawler(MailCrawler): folderItems = getattr(folder, 'Items') for item in range(len(folderItems)): mail = folderItems.Item(item+1) - if mail.Class == api.win32com.client.constants.olMail: + if mail.Class == api.client.constants.olMail: if self.keys is None: self.keys = [] for key in mail._prop_map_get_: diff --git a/agent/testing/winapi.py b/agent/testing/winapi.py index 5fb13de..bc47d7a 100644 --- a/agent/testing/winapi.py +++ b/agent/testing/winapi.py @@ -24,12 +24,30 @@ $Id$ client = ctypes = win32api = win32process = win32con = None +class Mail(object): + + #this is just a guess what a Outlook Mail Object Probably returns + Class = None + + def __init__(self): + Class = self.__class__ + + def _prop_map_get_(self): + #here it is necessary of what attributes (called keys in outlok.py) + #an Outlook Mail typically has + # should return a tuple () + pass + class OutlookFolder(object): - Items = {'mail1': "eMail 1", 'mail2': "eMail2"} + Items = {} + # Folders defines in Outlook the sub folders under the "Main" Folder + Folders = None def __init__(self): + Items[0] = Mail() + Items[1] = Mail() pass @@ -51,18 +69,26 @@ class OutlookApp(object): def GetNamespace(self, message=""): print "Namespace " + message + " retrieved" - return + oNamespace = OutlookNamespace() + return oNamespace class Message(object): olFolderInbox = None + # esp. for olMail, for further dummy implementations it is necessary + # to find out, what class is expected. Meaning what type of object has + # to be faked and what attributes it has. see outlook.py + # loadMailsfromFolder + olMail = Mail() def __init__(self): pass def EnsureDispatch(self, message=""): print message + " retrieved" + oApp = OutlookApp() + return oApp class client(object):