<s> import mailbox <EOL> __all__ = [ '<STR_LIT>' ] <EOL> log = __import__ ( '<STR_LIT>' ) . getLogger ( __name__ ) <EOL> class MailboxTransport ( object ) : <EOL> """<STR_LIT>""" <EOL> __slots__ = ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT:filename>' ) <EOL> def __init__ ( self , config ) : <EOL> self . box = None <EOL> self . filename = config . get ( '<STR_LIT:file>' , None ) <EOL> if not self . filename : <EOL> raise ValueError ( "<STR_LIT>" ) <EOL> def startup ( self ) : <EOL> self . box = mailbox . mbox ( self . filename ) <EOL> def deliver ( self , message ) : <EOL> self . box . lock ( ) <EOL> self . box . add ( mailbox . mboxMessage ( str ( message ) ) ) <EOL> self . box . unlock ( ) <EOL> def shutdown ( self ) : <EOL> if self . box is None : <EOL> return <EOL> self . box . close ( ) <EOL> self . box = None </s>
