Changeset 391 for python/trunk/Doc/library/mailbox.rst
- Timestamp:
- Mar 19, 2014, 11:31:01 PM (11 years ago)
- Location:
- python/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
python/trunk
-
Property svn:mergeinfo
set to
/python/vendor/Python-2.7.6 merged eligible /python/vendor/current merged eligible
-
Property svn:mergeinfo
set to
-
python/trunk/Doc/library/mailbox.rst
r2 r391 12 12 accessing and manipulating on-disk mailboxes and the messages they contain. 13 13 :class:`Mailbox` offers a dictionary-like mapping from keys to messages. 14 :class:`Message` extends the :mod:`email.Message` module's :class:`Message` 15 class with format-specific state and behavior. Supported mailbox formats are 14 :class:`Message` extends the :mod:`email.message` module's 15 :class:`~email.message.Message` class with format-specific state and behavior. 16 Supported mailbox formats are 16 17 Maildir, mbox, MH, Babyl, and MMDF. 17 18 … … 84 85 85 86 Parameter *message* may be a :class:`Message` instance, an 86 :class:`email. Message.Message` instance, a string, or a file-like object87 :class:`email.message.Message` instance, a string, or a file-like object 87 88 (which should be open in text mode). If *message* is an instance of the 88 89 appropriate format-specific :class:`Message` subclass (e.g., if it's an … … 111 112 112 113 As with :meth:`add`, parameter *message* may be a :class:`Message` 113 instance, an :class:`email. Message.Message` instance, a string, or a114 instance, an :class:`email.message.Message` instance, a string, or a 114 115 file-like object (which should be open in text mode). If *message* is an 115 116 instance of the appropriate format-specific :class:`Message` subclass … … 155 156 156 157 157 .. method:: get(key [, default=None])158 .. method:: get(key, default=None) 158 159 __getitem__(key) 159 160 … … 279 280 280 281 281 .. class:: Maildir(dirname [, factory=rfc822.Message[, create=True]])282 .. class:: Maildir(dirname, factory=rfc822.Message, create=True) 282 283 283 284 A subclass of :class:`Mailbox` for mailboxes in Maildir format. Parameter … … 424 425 425 426 426 .. class:: mbox(path [, factory=None[, create=True]])427 .. class:: mbox(path, factory=None, create=True) 427 428 428 429 A subclass of :class:`Mailbox` for mailboxes in mbox format. Parameter *factory* … … 460 461 461 462 Three locking mechanisms are used---dot locking and, if available, the 462 :c func:`flock` and :cfunc:`lockf` system calls.463 :c:func:`flock` and :c:func:`lockf` system calls. 463 464 464 465 … … 484 485 485 486 486 .. class:: MH(path [, factory=None[, create=True]])487 .. class:: MH(path, factory=None, create=True) 487 488 488 489 A subclass of :class:`Mailbox` for mailboxes in MH format. Parameter *factory* … … 574 575 575 576 Three locking mechanisms are used---dot locking and, if available, the 576 :c func:`flock` and :cfunc:`lockf` system calls. For MH mailboxes, locking577 :c:func:`flock` and :c:func:`lockf` system calls. For MH mailboxes, locking 577 578 the mailbox means locking the :file:`.mh_sequences` file and, only for the 578 579 duration of any operations that affect them, locking individual message … … 614 615 615 616 616 .. class:: Babyl(path [, factory=None[, create=True]])617 .. class:: Babyl(path, factory=None, create=True) 617 618 618 619 A subclass of :class:`Mailbox` for mailboxes in Babyl format. Parameter … … 661 662 In Babyl mailboxes, the headers of a message are not stored contiguously 662 663 with the body of the message. To generate a file-like representation, the 663 headers and body are copied together into a :class:` StringIO` instance664 headers and body are copied together into a :class:`~StringIO.StringIO` instance 664 665 (from the :mod:`StringIO` module), which has an API identical to that of a 665 666 file. As a result, the file-like object is truly independent of the … … 672 673 673 674 Three locking mechanisms are used---dot locking and, if available, the 674 :c func:`flock` and :cfunc:`lockf` system calls.675 :c:func:`flock` and :c:func:`lockf` system calls. 675 676 676 677 … … 690 691 691 692 692 .. class:: MMDF(path [, factory=None[, create=True]])693 .. class:: MMDF(path, factory=None, create=True) 693 694 694 695 A subclass of :class:`Mailbox` for mailboxes in MMDF format. Parameter *factory* … … 723 724 724 725 Three locking mechanisms are used---dot locking and, if available, the 725 :c func:`flock` and :cfunc:`lockf` system calls.726 :c:func:`flock` and :c:func:`lockf` system calls. 726 727 727 728 … … 744 745 .. class:: Message([message]) 745 746 746 A subclass of the :mod:`email.Message` module's :class:`Message`. Subclasses of 747 :class:`mailbox.Message` add mailbox-format-specific state and behavior. 747 A subclass of the :mod:`email.message` module's 748 :class:`~email.message.Message`. Subclasses of :class:`mailbox.Message` add 749 mailbox-format-specific state and behavior. 748 750 749 751 If *message* is omitted, the new instance is created in a default, empty state. 750 If *message* is an :class:`email. Message.Message` instance, its contents are752 If *message* is an :class:`email.message.Message` instance, its contents are 751 753 copied; furthermore, any format-specific information is converted insofar as 752 754 possible if *message* is a :class:`Message` instance. If *message* is a string … … 766 768 messages retrieved using :class:`Mailbox` instances. In some situations, the 767 769 time and memory required to generate :class:`Message` representations might 768 not notacceptable. For such situations, :class:`Mailbox` instances also770 not be acceptable. For such situations, :class:`Mailbox` instances also 769 771 offer string and file-like representations, and a custom message factory may 770 772 be specified when a :class:`Mailbox` instance is initialized. … … 988 990 989 991 990 .. method:: set_from(from_ [, time_=None])992 .. method:: set_from(from_, time_=None) 991 993 992 994 Set the "From " line to *from_*, which should be specified without a 993 995 leading "From " or trailing newline. For convenience, *time_* may be 994 996 specified and will be formatted appropriately and appended to *from_*. If 995 *time_* is specified, it should be a :class:` struct_time` instance, a997 *time_* is specified, it should be a :class:`time.struct_time` instance, a 996 998 tuple suitable for passing to :meth:`time.strftime`, or ``True`` (to use 997 999 :meth:`time.gmtime`). … … 1252 1254 Set the message's visible headers to be the same as the headers in 1253 1255 *message*. Parameter *visible* should be a :class:`Message` instance, an 1254 :class:`email. Message.Message` instance, a string, or a file-like object1256 :class:`email.message.Message` instance, a string, or a file-like object 1255 1257 (which should be open in text mode). 1256 1258 … … 1359 1361 1360 1362 1361 .. method:: set_from(from_ [, time_=None])1363 .. method:: set_from(from_, time_=None) 1362 1364 1363 1365 Set the "From " line to *from_*, which should be specified without a 1364 1366 leading "From " or trailing newline. For convenience, *time_* may be 1365 1367 specified and will be formatted appropriately and appended to *from_*. If 1366 *time_* is specified, it should be a :class:` struct_time` instance, a1368 *time_* is specified, it should be a :class:`time.struct_time` instance, a 1367 1369 tuple suitable for passing to :meth:`time.strftime`, or ``True`` (to use 1368 1370 :meth:`time.gmtime`). … … 1514 1516 represent format-specific message properties. For backward compatibility, the 1515 1517 older mailbox classes are still available, but the newer classes should be used 1516 in preference to them. The old classes will be removed in Python 3.0.1518 in preference to them. The old classes have been removed in Python 3. 1517 1519 1518 1520 Older mailbox objects support only iteration and provide a single public method:
Note:
See TracChangeset
for help on using the changeset viewer.