Changeset 250:1fdb2f77fb2a
- Timestamp:
- 05/06/11 17:45:04 (12 months ago)
- Author:
- Menno Smits <menno@…>
- Branch:
- default
- Message:
-
Fixed up documentation for recently added functionality
- Files:
-
Legend:
- Unmodified
- Added
- Removed
-
|
r249
|
r250
|
|
| 66 | 66 | If *ssl* is ``True`` an SSL connection will be made (defaults to |
| 67 | 67 | ``False``). |
| | 68 | |
| | 69 | The *debug* property can be used to enable debug logging. It can |
| | 70 | be set to an integer from 0 to 5 where 0 disables debug output and |
| | 71 | 5 enables full output with wire logging and parsing logs. ``True`` |
| | 72 | and ``False`` can also be assigned where ``True`` sets debug level |
| | 73 | 4. |
| | 74 | |
| | 75 | By default, debug output goes to stderr. The *log_file* attribute |
| | 76 | can be assigned to an alternate file handle for writing debug |
| | 77 | output to. |
| 68 | 78 | """ |
| 69 | 79 | |
| … |
… |
|
| 105 | 115 | def oauth_login(self, url, oauth_token, oauth_token_secret, |
| 106 | 116 | consumer_key='anonymous', consumer_secret='anonymous'): |
| 107 | | """Authenticate using oauth. |
| 108 | | |
| 109 | | @param url: The OAuth request URL. |
| 110 | | @param oauth_token: An OAuth key. |
| 111 | | @param oauth_token_secret: An OAuth secret. |
| 112 | | @param consumer_key: An OAuth consumer key (defaults to 'anonymous'). |
| 113 | | @param consumer_secret: An OAuth consumer secret (defaults to 'anonymous'). |
| | 117 | """Authenticate using the OAUTH method. |
| | 118 | |
| | 119 | This only works with IMAP servers that support OAUTH (eg. Gmail). |
| 114 | 120 | """ |
| 115 | 121 | if oauth2: |
| … |
… |
|
| 162 | 168 | *shared*. |
| 163 | 169 | |
| 164 | | See RFC 2342 for more details. |
| | 170 | See `RFC-2342 <http://tools.ietf.org/html/rfc2342>`_ for more details. |
| 165 | 171 | """ |
| 166 | 172 | typ, data = self._imap.namespace() |
| … |
… |
|
| 303 | 309 | |
| 304 | 310 | def idle(self): |
| 305 | | """Put server into IDLE mode. |
| | 311 | """Put the server into IDLE mode. |
| 306 | 312 | |
| 307 | 313 | In this mode the server will return unsolicited responses |
| 308 | | about changes to the selected mailbox. |
| 309 | | |
| 310 | | This method returns immediately. Use idle_check() to check for |
| 311 | | IDLE responses and idle_done() to stop IDLE mode. |
| 312 | | |
| 313 | | Note: Any other commmands issued while the server is in IDLE |
| 314 | | mode will fail. |
| 315 | | |
| 316 | | See RFC 2177 for more information about the IDLE extension. |
| 317 | | http://tools.ietf.org/html/rfc2177 |
| | 314 | about changes to the selected mailbox. This method returns |
| | 315 | immediately. Use ``idle_check()`` to look for IDLE responses |
| | 316 | and ``idle_done()`` to stop IDLE mode. |
| | 317 | |
| | 318 | .. note:: |
| | 319 | |
| | 320 | Any other commmands issued while the server is in IDLE |
| | 321 | mode will fail. |
| | 322 | |
| | 323 | See `RFC 2177 <http://tools.ietf.org/html/rfc2177>`_ for more |
| | 324 | information about the IDLE extension. |
| 318 | 325 | """ |
| 319 | 326 | self._idle_tag = self._imap._command('IDLE') |
| … |
… |
|
| 326 | 333 | |
| 327 | 334 | This method should only be called if the server is in IDLE |
| 328 | | mode (see idle()). |
| | 335 | mode (see ``idle()``). |
| 329 | 336 | |
| 330 | 337 | By default, this method will block until an IDLE response is |
| 331 | | received. If timeout is provided, the call will block for at |
| 332 | | most this number of seconds while waiting for an IDLE response. |
| | 338 | received. If *timeout* is provided, the call will block for at |
| | 339 | most this many seconds while waiting for an IDLE response. |
| 333 | 340 | |
| 334 | 341 | The return value is a list of received IDLE responses. These |
| 335 | 342 | will be parsed with values converted to appropriate types. For |
| 336 | | example: |
| 337 | | |
| 338 | | [('OK', 'Still here'), |
| 339 | | (1, 'EXISTS'), |
| 340 | | (1, 'FETCH', ('FLAGS', ('\\NotJunk',)))] |
| | 343 | example:: |
| | 344 | |
| | 345 | [('OK', 'Still here'), |
| | 346 | (1, 'EXISTS'), |
| | 347 | (1, 'FETCH', ('FLAGS', ('\\NotJunk',)))] |
| 341 | 348 | """ |
| 342 | 349 | # make the socket non-blocking so the timeout can be |
| … |
… |
|
| 365 | 372 | """Take the server out of IDLE mode. |
| 366 | 373 | |
| 367 | | This method should only be called if the server is in IDLE mode. |
| 368 | | |
| 369 | | The return value is (command_text, idle_responses) where |
| 370 | | command_text is the text sent by the server when the IDLE |
| 371 | | command finished (eg. 'Idle terminated') and idle_responses is |
| 372 | | a list of parsed idle responses received since the last call |
| 373 | | to idle_check() (if any). These are returned in parsed form as |
| 374 | | per idle_check(). |
| | 374 | This method should only be called if the server is already in |
| | 375 | IDLE mode. |
| | 376 | |
| | 377 | The return value is of the form ``(command_text, |
| | 378 | idle_responses)`` where *command_text* is the text sent by the |
| | 379 | server when the IDLE command finished (eg. ``'Idle |
| | 380 | terminated'``) and *idle_responses* is a list of parsed idle |
| | 381 | responses received since the last call to ``idle_check()`` (if |
| | 382 | any). These are returned in parsed form as per |
| | 383 | ``idle_check()``. |
| 375 | 384 | """ |
| 376 | 385 | self._imap.send('DONE\r\n') |
| … |
… |
|
| 788 | 797 | self._imap.debug = level |
| 789 | 798 | |
| 790 | | debug = property(__debug_get, __debug_set, |
| 791 | | doc="Set debug level. Integers from 0 to 5 or, True and " \ |
| 792 | | "False can be used. True specifies debug level 4. " \ |
| 793 | | "Debug output goes to stderr.") |
| | 799 | debug = property(__debug_get, __debug_set) |
| 794 | 800 | |
| 795 | 801 | def _log(self, text): |