当前位置: 首页>>代码示例>>Python>>正文


Python InputMail.from_python_mail方法代码示例

本文整理汇总了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)
开发者ID:bwagnerr,项目名称:pixelated-user-agent,代码行数:9,代码来源:test_mail.py

示例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)
开发者ID:bwagnerr,项目名称:pixelated-user-agent,代码行数:9,代码来源:test_mail.py

示例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)
开发者ID:Josue23,项目名称:pixelated-user-agent,代码行数:10,代码来源:welcome_mail.py

示例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)
开发者ID:tcz001,项目名称:pixelated-user-agent,代码行数:10,代码来源:application.py

示例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)
开发者ID:SamuelToh,项目名称:pixelated-user-agent,代码行数:13,代码来源:leap.py

示例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)
开发者ID:carriercomm,项目名称:pixelated-user-agent,代码行数:13,代码来源:test_welcome_mail.py


注:本文中的pixelated.adapter.model.mail.InputMail.from_python_mail方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。