當前位置: 首頁>>代碼示例>>Python>>正文


Python message._explain_to方法代碼示例

本文整理匯總了Python中email.message._explain_to方法的典型用法代碼示例。如果您正苦於以下問題:Python message._explain_to方法的具體用法?Python message._explain_to怎麽用?Python message._explain_to使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在email.message的用法示例。


在下文中一共展示了message._explain_to方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: __init__

# 需要導入模塊: from email import message [as 別名]
# 或者: from email.message import _explain_to [as 別名]
def __init__(self, message=None):
        """Initialize a Message instance."""
        if isinstance(message, email.message.Message):
            self._become_message(copy.deepcopy(message))
            if isinstance(message, Message):
                message._explain_to(self)
        elif isinstance(message, bytes):
            self._become_message(email.message_from_bytes(message))
        elif isinstance(message, str):
            self._become_message(email.message_from_string(message))
        elif isinstance(message, io.TextIOWrapper):
            self._become_message(email.message_from_file(message))
        elif hasattr(message, "read"):
            self._become_message(email.message_from_binary_file(message))
        elif message is None:
            email.message.Message.__init__(self)
        else:
            raise TypeError('Invalid message type: %s' % type(message)) 
開發者ID:Microvellum,項目名稱:Fluid-Designer,代碼行數:20,代碼來源:mailbox.py

示例2: __init__

# 需要導入模塊: from email import message [as 別名]
# 或者: from email.message import _explain_to [as 別名]
def __init__(self, message=None):
        """Initialize a Message instance."""
        if isinstance(message, email.message.Message):
            self._become_message(copy.deepcopy(message))
            if isinstance(message, Message):
                message._explain_to(self)
        elif isinstance(message, str):
            self._become_message(email.message_from_string(message))
        elif hasattr(message, "read"):
            self._become_message(email.message_from_file(message))
        elif message is None:
            email.message.Message.__init__(self)
        else:
            raise TypeError('Invalid message type: %s' % type(message)) 
開發者ID:glmcdona,項目名稱:meddle,代碼行數:16,代碼來源:mailbox.py

示例3: _explain_to

# 需要導入模塊: from email import message [as 別名]
# 或者: from email.message import _explain_to [as 別名]
def _explain_to(self, message):
        """Copy format-specific state to message insofar as possible."""
        if isinstance(message, Message):
            return  # There's nothing format-specific to explain.
        else:
            raise TypeError('Cannot convert to specified type') 
開發者ID:glmcdona,項目名稱:meddle,代碼行數:8,代碼來源:mailbox.py


注:本文中的email.message._explain_to方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。