<s> from django . conf import settings <EOL> import abc <EOL> class AbstractMailWriter ( object ) : <EOL> __metaclass__ = abc . ABCMeta <EOL> @ property <EOL> def formats ( self ) : <EOL> return [ '<STR_LIT:text>' ] <EOL> @ classmethod <EOL> def open ( cls , context = None ) : <EOL> if context is None : <EOL> context = { } <EOL> return cls ( ** context ) <EOL> def __init__ ( self , ** context ) : <EOL> self . context = context <EOL> def __enter__ ( self ) : <EOL> self . setup ( ) <EOL> return self <EOL> def __exit__ ( self , type , value , traceback ) : <EOL> self . teardown ( ) <EOL> def setup ( self ) : <EOL> pass <EOL> def teardown ( self ) : <EOL> pass <EOL> @ abc . abstractmethod <EOL> def get_to ( self ) : <EOL> pass <EOL> @ abc . abstractmethod <EOL> def get_subject ( self ) : <EOL> pass <EOL> @ abc . abstractmethod <EOL> def get_body ( self , format ) : <EOL> pass <EOL> def get_bcc ( self ) : <EOL> return [ ] <EOL> def get_from ( self ) : <EOL> return settings . DEFAULT_FROM_EMAIL <EOL> def get_attachments ( self ) : <EOL> return [ ] <EOL> def get_headers ( self ) : <EOL> return { } </s>
