Package buildbot :: Package changes :: Module maildirtwisted :: Class MaildirService
[frames | no frames]

Class MaildirService

   Maildir --+    
             |    
   Service --+    
             |    
MaildirTwisted --+
                 |
                MaildirService


I watch a maildir for new messages. I should be placed as the service child of some MultiService instance. When running, I use the linux dirwatcher API (if available) or poll for new files in the 'new' subdirectory of my maildir path. When I discover a new message, I invoke my parent's .messageReceived() method with the short filename of the new message, so the full name of the new file can be obtained with os.path.join(maildir, 'new', filename). I will not move or delete the file on my own: the parent should do this in messageReceived().
Method Summary
  messageReceived(self, filename)
Called when a new file is noticed.
    Inherited from MaildirTwisted
  dnotify_callback(self)
  startService(self)
  startTimeout(self)
  stopService(self)
  stopTimeout(self)
    Inherited from Maildir
  __init__(self, basedir)
Create the Maildir watcher.
  poll(self)
  setBasedir(self, basedir)
  start(self)
You must run start to receive any messages.
  stop(self)
    Inherited from Service
  __getstate__(self)
  disownServiceParent(self)
  privilegedStartService(self)
  setName(self, name)
  setServiceParent(self, parent)

Class Variable Summary
    Inherited from MaildirTwisted
NoneType timeout = None                                                                  
    Inherited from Service
Implements __implemented__ = <implementedBy twisted.application.ser...
ClassProvides __providedBy__ = <zope.interface.declarations.ClassProvi...
ClassProvides __provides__ = <zope.interface.declarations.ClassProvide...
NoneType name = None                                                                  
NoneType parent = None                                                                  
int running = 0                                                                     

Method Details

messageReceived(self, filename)

Called when a new file is noticed. Override it in subclasses. Will receive path relative to maildir/new.
Overrides:
buildbot.changes.maildir.Maildir.messageReceived (inherited documentation)

Generated by Epydoc 2.1 on Sun Dec 10 22:04:44 2006 http://epydoc.sf.net