Package turbomail :: Package extensions :: Module utf8qp
[hide private]
[frames] | no frames]

Source Code for Module turbomail.extensions.utf8qp

 1  # encoding: utf-8 
 2   
 3  """TurboMail UTF-8 quoted-printable encoding extension.""" 
 4   
 5   
 6  import logging 
 7   
 8  from turbomail.api import Extension 
 9  from turbomail.compat import charset 
10   
11   
12  __all__ = ['interface', 'UTF8QuotedPrintable'] 
13   
14  log = logging.getLogger("turbomail.extension.utf8qp") 
15   
16   
17   
18 -class UTF8QuotedPrintable(Extension):
19 name = 'utf8qp' 20
21 - def start(self):
22 super(UTF8QuotedPrintable, self).start() 23 24 log.info("Configuring UTF-8 character set to use Quoted-Printable encoding.") 25 charset.add_charset('utf-8', charset.SHORTEST, charset.QP, 'utf-8') 26 charset.add_charset('utf8', charset.SHORTEST, charset.QP, 'utf8')
27
28 - def stop(self):
29 super(UTF8QuotedPrintable, self).stop() 30 31 log.info("Configuring UTF-8 character set to use Base-64 encoding.") 32 charset.add_charset('utf-8', charset.SHORTEST, charset.BASE64, 'utf-8') 33 charset.add_charset('utf8', charset.SHORTEST, charset.BASE64, 'utf8')
34 35 36 interface = UTF8QuotedPrintable() 37