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

Class MaildirService

 Service --+    
           |    
MultiService --+
               |
              MaildirService

Known Subclasses:
MaildirSource

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 .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). messageReceived() should be overridden by a subclass to do something useful. I will not move or delete the file on my own: the subclass's messageReceived() should probably do that.
Method Summary
  __init__(self, basedir)
Create the Maildir watcher.
  dnotify_callback(self)
  messageReceived(self, filename)
Called when a new file is noticed.
  poll(self)
  setBasedir(self, basedir)
  startService(self)
  stopService(self)
    Inherited from MultiService
  __iter__(self)
  addService(self, service)
  getServiceNamed(self, name)
  privilegedStartService(self)
  removeService(self, service)
    Inherited from Service
  __getstate__(self)
  disownServiceParent(self)
  setName(self, name)
  setServiceParent(self, parent)

Class Variable Summary
Implements __implemented__ = <implementedBy buildbot.changes.maildi...
ClassProvides __provides__ = <zope.interface.declarations.ClassProvide...
int pollinterval = 10                                                                    
    Inherited from MultiService
_implementsTuple __implements__ = (<MetaInterface twisted.application.ser...
    Inherited from Service
ClassProvides __providedBy__ = <zope.interface.declarations.ClassProvi...
NoneType name = None                                                                  
NoneType parent = None                                                                  
int running = 0                                                                     

Method Details

__init__(self, basedir=None)
(Constructor)

Create the Maildir watcher. BASEDIR is the maildir directory (the one which contains new/ and tmp/)
Overrides:
twisted.application.service.MultiService.__init__

messageReceived(self, filename)

Called when a new file is noticed. Will call self.parent.messageReceived() with a path relative to maildir/new. Should probably be overridden in subclasses.

Class Variable Details

__implemented__

Type:
Implements
Value:
<implementedBy buildbot.changes.maildir.MaildirService>                

__provides__

Type:
ClassProvides
Value:
<zope.interface.declarations.ClassProvides object at 0x2b9178ecd7d0>   

pollinterval

Type:
int
Value:
10                                                                    

Generated by Epydoc 2.1 on Tue Sep 16 09:16:00 2008 http://epydoc.sf.net