+++ /dev/null
-# Copyright (C) 2001-2006 Python Software Foundation\r
-# Author: Keith Dart\r
-# Contact: email-sig@python.org\r
-\r
-"""Class representing application/* type MIME documents."""\r
-\r
-__all__ = ["MIMEApplication"]\r
-\r
-from email import encoders\r
-from email.mime.nonmultipart import MIMENonMultipart\r
-\r
-\r
-class MIMEApplication(MIMENonMultipart):\r
- """Class for generating application/* MIME documents."""\r
-\r
- def __init__(self, _data, _subtype='octet-stream',\r
- _encoder=encoders.encode_base64, **_params):\r
- """Create an application/* type MIME document.\r
-\r
- _data is a string containing the raw application data.\r
-\r
- _subtype is the MIME content type subtype, defaulting to\r
- 'octet-stream'.\r
-\r
- _encoder is a function which will perform the actual encoding for\r
- transport of the application data, defaulting to base64 encoding.\r
-\r
- Any additional keyword arguments are passed to the base class\r
- constructor, which turns them into parameters on the Content-Type\r
- header.\r
- """\r
- if _subtype is None:\r
- raise TypeError('Invalid application MIME subtype')\r
- MIMENonMultipart.__init__(self, 'application', _subtype, **_params)\r
- self.set_payload(_data)\r
- _encoder(self)\r