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


Python quoprimime.unquote方法代码示例

本文整理汇总了Python中email.quoprimime.unquote方法的典型用法代码示例。如果您正苦于以下问题:Python quoprimime.unquote方法的具体用法?Python quoprimime.unquote怎么用?Python quoprimime.unquote使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在email.quoprimime的用法示例。


在下文中一共展示了quoprimime.unquote方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_set_param

# 需要导入模块: from email import quoprimime [as 别名]
# 或者: from email.quoprimime import unquote [as 别名]
def test_set_param(self):
        eq = self.assertEqual
        msg = Message()
        msg.set_param('charset', 'iso-2022-jp')
        eq(msg.get_param('charset'), 'iso-2022-jp')
        msg.set_param('importance', 'high value')
        eq(msg.get_param('importance'), 'high value')
        eq(msg.get_param('importance', unquote=False), '"high value"')
        eq(msg.get_params(), [('text/plain', ''),
                              ('charset', 'iso-2022-jp'),
                              ('importance', 'high value')])
        eq(msg.get_params(unquote=False), [('text/plain', ''),
                                       ('charset', '"iso-2022-jp"'),
                                       ('importance', '"high value"')])
        msg.set_param('charset', 'iso-9999-xx', header='X-Jimmy')
        eq(msg.get_param('charset', header='X-Jimmy'), 'iso-9999-xx') 
开发者ID:IronLanguages,项目名称:ironpython2,代码行数:18,代码来源:test_email_renamed.py

示例2: test_get_param_with_semis_in_quotes

# 需要导入模块: from email import quoprimime [as 别名]
# 或者: from email.quoprimime import unquote [as 别名]
def test_get_param_with_semis_in_quotes(self):
        msg = email.message_from_string(
            'Content-Type: image/pjpeg; name="Jim&&Jill"\n')
        self.assertEqual(msg.get_param('name'), 'Jim&&Jill')
        self.assertEqual(msg.get_param('name', unquote=False),
                         '"Jim&&Jill"') 
开发者ID:IronLanguages,项目名称:ironpython2,代码行数:8,代码来源:test_email_renamed.py

示例3: test_quote_unquote_idempotent

# 需要导入模块: from email import quoprimime [as 别名]
# 或者: from email.quoprimime import unquote [as 别名]
def test_quote_unquote_idempotent(self):
        for x in range(256):
            c = chr(x)
            self.assertEqual(quoprimime.unquote(quoprimime.quote(c)), c) 
开发者ID:IronLanguages,项目名称:ironpython2,代码行数:6,代码来源:test_email_renamed.py

示例4: test_get_param

# 需要导入模块: from email import quoprimime [as 别名]
# 或者: from email.quoprimime import unquote [as 别名]
def test_get_param(self):
        eq = self.assertEqual
        msg = self._msgobj('msg_29.txt')
        eq(msg.get_param('title'),
           ('us-ascii', 'en', 'This is even more ***fun*** isn\'t it!'))
        eq(msg.get_param('title', unquote=False),
           ('us-ascii', 'en', '"This is even more ***fun*** isn\'t it!"')) 
开发者ID:IronLanguages,项目名称:ironpython2,代码行数:9,代码来源:test_email_renamed.py

示例5: test_get_param_with_semis_in_quotes

# 需要导入模块: from email import quoprimime [as 别名]
# 或者: from email.quoprimime import unquote [as 别名]
def test_get_param_with_semis_in_quotes(self):
        msg = email.message_from_string(
            'Content-Type: image/pjpeg; name="Jim&&Jill"\n')
        self.assertEqual(msg.get_param('name'), 'Jim&&Jill')
        self.assertEqual(msg.get_param('name', unquote=False),
                         '"Jim&&Jill"')

    # test_headerregistry.TestContentTypeHeader.quotes_inside_rfc2231_value 
开发者ID:IronLanguages,项目名称:ironpython3,代码行数:10,代码来源:test_email.py


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