當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。