~ubuntu-branches/ubuntu/precise/python3.2/precise

« back to all changes in this revision

Viewing changes to Doc/library/imaplib.rst

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2011-02-14 16:12:14 UTC
  • mfrom: (10.1.3 experimental)
  • Revision ID: james.westby@ubuntu.com-20110214161214-f5vwa226kebccmt9
Tags: 3.2~rc3-1
Python 3.2 release candidate 3.

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
   pair: IMAP4_SSL; protocol
17
17
   pair: IMAP4_stream; protocol
18
18
 
 
19
**Source code:** :source:`Lib/imaplib.py`
 
20
 
 
21
--------------
 
22
 
19
23
This module defines three classes, :class:`IMAP4`, :class:`IMAP4_SSL` and
20
24
:class:`IMAP4_stream`, which encapsulate a connection to an IMAP4 server and
21
25
implement a large subset of the IMAP4rev1 client protocol as defined in
85
89
 
86
90
.. function:: Internaldate2tuple(datestr)
87
91
 
88
 
   Converts an IMAP4 INTERNALDATE string to Coordinated Universal Time. Returns a
89
 
   :mod:`time` module tuple.
90
 
 
 
92
   Parse an IMAP4 ``INTERNALDATE`` string and return corresponding local
 
93
   time.  The return value is a :class:`time.struct_time` tuple or
 
94
   None if the string has wrong format.
91
95
 
92
96
.. function:: Int2AP(num)
93
97
 
102
106
 
103
107
.. function:: Time2Internaldate(date_time)
104
108
 
105
 
   Converts a :mod:`time` module tuple to an IMAP4 ``INTERNALDATE`` representation.
106
 
   Returns a string in the form: ``"DD-Mmm-YYYY HH:MM:SS +HHMM"`` (including
107
 
   double-quotes).
 
109
   Convert *date_time* to an IMAP4 ``INTERNALDATE`` representation.  The
 
110
   return value is a string in the form: ``"DD-Mmm-YYYY HH:MM:SS
 
111
   +HHMM"`` (including double-quotes).  The *date_time* argument can be a
 
112
   number (int or float) represening seconds since epoch (as returned
 
113
   by :func:`time.time`), a 9-tuple representing local time (as returned by
 
114
   :func:`time.localtime`), or a double-quoted string.  In the last case, it
 
115
   is assumed to already be in the correct format.
108
116
 
109
117
Note that IMAP4 message numbers change as the mailbox changes; in particular,
110
118
after an ``EXPUNGE`` command performs deletions the remaining messages are
290
298
 
291
299
.. method:: IMAP4.open(host, port)
292
300
 
293
 
   Opens socket to *port* at *host*. The connection objects established by this
 
301
   Opens socket to *port* at *host*.  This method is implicitly called by
 
302
   the :class:`IMAP4` constructor.  The connection objects established by this
294
303
   method will be used in the ``read``, ``readline``, ``send``, and ``shutdown``
295
 
   methods. You may override this method.
 
304
   methods.  You may override this method.
296
305
 
297
306
 
298
307
.. method:: IMAP4.partial(message_num, message_part, start, length)
382
391
 
383
392
.. method:: IMAP4.shutdown()
384
393
 
385
 
   Close connection established in ``open``. You may override this method.
 
394
   Close connection established in ``open``.  This method is implicitly
 
395
   called by :meth:`IMAP4.logout`.  You may override this method.
386
396
 
387
397
 
388
398
.. method:: IMAP4.socket()