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


Python iterators.walk方法代码示例

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


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

示例1: get_charsets

# 需要导入模块: from email import iterators [as 别名]
# 或者: from email.iterators import walk [as 别名]
def get_charsets(self, failobj=None):
        """Return a list containing the charset(s) used in this message.

        The returned list of items describes the Content-Type headers'
        charset parameter for this message and all the subparts in its
        payload.

        Each item will either be a string (the value of the charset parameter
        in the Content-Type header of that part) or the value of the
        'failobj' parameter (defaults to None), if the part does not have a
        main MIME type of "text", or the charset is not defined.

        The list will contain one string for each part of the message, plus
        one for the container message (i.e. self), so that a non-multipart
        message will still return a list of length 1.
        """
        return [part.get_content_charset(failobj) for part in self.walk()]

    # I.e. def walk(self): ... 
开发者ID:glmcdona,项目名称:meddle,代码行数:21,代码来源:message.py

示例2: get_charsets

# 需要导入模块: from email import iterators [as 别名]
# 或者: from email.iterators import walk [as 别名]
def get_charsets(self, failobj=None):
        """Return a list containing the charset(s) used in this message.

        The returned list of items describes the Content-Type headers'
        charset parameter for this message and all the subparts in its
        payload.

        Each item will either be a string (the value of the charset parameter
        in the Content-Type header of that part) or the value of the
        'failobj' parameter (defaults to None), if the part does not have a
        main MIME type of "text", or the charset is not defined.

        The list will contain one string for each part of the message, plus
        one for the container message (i.e. self), so that a non-multipart
        message will still return a list of length 1.
        """
        return [part.get_content_charset(failobj) for part in self.walk()] 
开发者ID:Microvellum,项目名称:Fluid-Designer,代码行数:19,代码来源:message.py

示例3: get_content_disposition

# 需要导入模块: from email import iterators [as 别名]
# 或者: from email.iterators import walk [as 别名]
def get_content_disposition(self):
        """Return the message's content-disposition if it exists, or None.

        The return values can be either 'inline', 'attachment' or None
        according to the rfc2183.
        """
        value = self.get('content-disposition')
        if value is None:
            return None
        c_d = _splitparam(value)[0].lower()
        return c_d

    # I.e. def walk(self): ... 
开发者ID:Microvellum,项目名称:Fluid-Designer,代码行数:15,代码来源:message.py


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