cybertools/agent/crawl/Outlook.txt
scrat 5aee688a12 check-in. At the moment problem with doctests for README.txt in cybertools/agent and cybertools/agent/crawl.Outlook.txt
Problem Nr. 1 in /agent/README.txt:
    master.config
Expected:
    controller.names = ['base.sample']
    logger.name = 'default'
    logger.standard = 30
    scheduler.name = 'sample'
Got:
    logger.name = 'default'
    logger.standard = 30
    scheduler.name = 'sample'


Problem Nr. 2 in /agent/crawl/Outlook.txt:
self.agent.setupAgents(self, [spec])
File "[..]\cybertools\agent\base\agent.py", line 85, in setupAgents
        agent.name = spec.name
    AttributeError: 'NoneType' object has no attribute 'name'


git-svn-id: svn://svn.cy55.de/Zope3/src/cybertools/trunk@2499 fd906abe-77d9-0310-91a1-e0d9ade77398
2008-04-06 17:28:30 +00:00

51 lines
1.6 KiB
Text

================================================
Agents for Job Execution and Communication Tasks
================================================
>>> from cybertools.agent.base.agent import Master
>>> config = '''
... controller(names=['core.sample'])
... scheduler(name='core')
... logger(name='default', standard=30)
... '''
>>> master = Master(config)
>>> master.setup()
OutlookCrawler
==============
The agent uses Twisted's cooperative multitasking model.
OutlookCrawler is derived from MailCrawler. The OutlookCrawler returns a deferred
which itself holds a list of MailResource Objects.
Returns a deferred that must be supplied with a callback method (and in
most cases also an errback method).
The TestCase here is using subsidiary methods which replace calls to the "real Outlook
dlls".
>>> controller = master.controllers[0]
>>> controller.createAgent('crawl.outlook', 'sample02')
In the next step we request the start of a job, again via the controller.
>>> controller.enterJob('outlook', 'sample02')
The job is not executed immediately - we have to hand over control to
the twisted reactor first.
>>> from cybertools.agent.crawl.outlook import OutlookCrawler
>>> from cybertools.agent.crawl.outlookstub import OutlookCrawlerStub
>>> OutlookCrawler.findOutlook = OutlookCrawlerStub.findOutlook
>>> OutlookCrawler = OutlookCrawlerStub
>>> from cybertools.agent.tests import tester
>>> tester.iterate()
Returning reference to Outlook Application
Retrieving Parameters
Crawling Folders
loading mails from folder
Job 00001 completed; result: [];