本文整理汇总了Python中pixelated.adapter.model.mail.InputMail.from_python_mail方法的典型用法代码示例。如果您正苦于以下问题:Python InputMail.from_python_mail方法的具体用法?Python InputMail.from_python_mail怎么用?Python InputMail.from_python_mail使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pixelated.adapter.model.mail.InputMail
的用法示例。
在下文中一共展示了InputMail.from_python_mail方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_charset_latin1
# 需要导入模块: from pixelated.adapter.model.mail import InputMail [as 别名]
# 或者: from pixelated.adapter.model.mail.InputMail import from_python_mail [as 别名]
def test_charset_latin1(self):
mail_file = pkg_resources.resource_filename('test.unit.fixtures', 'mail.latin1')
with open(mail_file) as latin1_mail:
mail = message_from_file(latin1_mail)
input_mail = InputMail.from_python_mail(mail)
body = u'latin1 é çñ\n'
self.assertEqual(body, input_mail.body)
示例2: test_charset_utf8
# 需要导入模块: from pixelated.adapter.model.mail import InputMail [as 别名]
# 或者: from pixelated.adapter.model.mail.InputMail import from_python_mail [as 别名]
def test_charset_utf8(self):
mail_file = pkg_resources.resource_filename('test.unit.fixtures', 'mail.utf8')
with open(mail_file) as utf8_mail:
mail = message_from_file(utf8_mail)
input_mail = InputMail.from_python_mail(mail)
body = u'utf8 é çñ\n'
self.assertEqual(body, input_mail.body)
示例3: add_welcome_mail
# 需要导入模块: from pixelated.adapter.model.mail import InputMail [as 别名]
# 或者: from pixelated.adapter.model.mail.InputMail import from_python_mail [as 别名]
def add_welcome_mail(mail_store):
welcome_mail = pkg_resources.resource_filename('pixelated.assets', 'welcome.mail')
with open(welcome_mail) as mail_template_file:
mail_template = message_from_file(mail_template_file)
input_mail = InputMail.from_python_mail(mail_template)
mail_store.add_mail('INBOX', input_mail.raw)
示例4: add_welcome_mail
# 需要导入模块: from pixelated.adapter.model.mail import InputMail [as 别名]
# 或者: from pixelated.adapter.model.mail.InputMail import from_python_mail [as 别名]
def add_welcome_mail(mail_store):
current_path = os.path.dirname(os.path.abspath(__file__))
welcome_mail = os.path.join(current_path, "assets", "welcome.mail")
with open(welcome_mail) as mail_template_file:
mail_template = message_from_file(mail_template_file)
input_mail = InputMail.from_python_mail(mail_template)
mail_store.add_mail("INBOX", input_mail.raw)
示例5: add_welcome_mail
# 需要导入模块: from pixelated.adapter.model.mail import InputMail [as 别名]
# 或者: from pixelated.adapter.model.mail.InputMail import from_python_mail [as 别名]
def add_welcome_mail(mail_store):
current_path = os.path.dirname(os.path.abspath(__file__))
with open(os.path.join(current_path,
'..',
'assets',
'welcome.mail')) as mail_template_file:
mail_template = message_from_file(mail_template_file)
input_mail = InputMail.from_python_mail(mail_template)
logging.getLogger('pixelated.config.leap').info('Adding the welcome mail')
mail_store.add_mail('INBOX', input_mail.raw)
示例6: _get_welcome_mail
# 需要导入模块: from pixelated.adapter.model.mail import InputMail [as 别名]
# 或者: from pixelated.adapter.model.mail.InputMail import from_python_mail [as 别名]
def _get_welcome_mail(self):
current_path = os.path.dirname(os.path.abspath(__file__))
with open(os.path.join(current_path,
'..',
'..',
'pixelated',
'assets',
'welcome.mail')) as mail_template_file:
mail_template = message_from_file(mail_template_file)
return InputMail.from_python_mail(mail_template)