Changeset 248:bbef196a11da
- Timestamp:
- 05/06/11 17:20:15 (12 months ago)
- Author:
- Menno Smits <menno@…>
- Branch:
- default
- Message:
-
Remaining gaps in IMAPClient class docs done.
This is sufficient for an initial release
- Files:
-
Legend:
- Unmodified
- Added
- Removed
-
|
r247
|
r248
|
|
| 111 | 111 | Any method that takes a folder name will accept a standard string or a |
| 112 | 112 | unicode string. Unicode strings will be transparently encoded using |
| 113 | | modified UTF-7 as specified by `RFC-3501 |
| | 113 | modified UTF-7 as specified by `RFC-3501 section 5.1.3 |
| 114 | 114 | <http://tools.ietf.org/html/rfc3501#section-5.1.3>`_. This allows for |
| 115 | 115 | arbitrary unicode characters (eg. non-English characters) to be used |
-
|
r245
|
r248
|
|
| 134 | 134 | """Return the folder separator used by the IMAP server. |
| 135 | 135 | |
| 136 | | WARNING: The implementation just picks the first folder |
| 137 | | separator from the first namespace returned. This is not |
| 138 | | particularly sensible. Use namespace instead(). |
| | 136 | .. warning:: |
| | 137 | |
| | 138 | The implementation just picks the first folder separator |
| | 139 | from the first namespace returned. This is not |
| | 140 | particularly sensible. Use namespace instead(). |
| 139 | 141 | """ |
| 140 | 142 | warnings.warn(DeprecationWarning('get_folder_delimiter is going away. Use namespace() instead.')) |
| … |
… |
|
| 344 | 346 | """Return a list of messages ids matching *criteria*. |
| 345 | 347 | |
| 346 | | XXX more detail |
| | 348 | *criteria* should be a list of of one or more criteria |
| | 349 | specifications or a single critera string. Example values |
| | 350 | include:: |
| | 351 | |
| | 352 | 'NOT DELETED' |
| | 353 | 'UNSEEN' |
| | 354 | 'SINCE 1-Feb-2011' |
| | 355 | |
| | 356 | *charset* specifies the character set of the strings in the |
| | 357 | criteria. It defaults to US-ASCII. |
| | 358 | |
| | 359 | See `RFC-3501 section 6.4.4 <http://tools.ietf.org/html/rfc3501#section-6.4.4>`_ |
| | 360 | for more details. |
| 347 | 361 | """ |
| 348 | 362 | if not criteria: |
| … |
… |
|
| 369 | 383 | |
| 370 | 384 | |
| 371 | | def sort(self, sort_criteria, criteria='ALL', charset='UTF-8' ): |
| | 385 | def sort(self, sort_criteria, criteria='ALL', charset='UTF-8'): |
| 372 | 386 | """Return a list of message ids sorted by *sort_criteria* and |
| 373 | 387 | optionally filtered by *criteria*. |
| 374 | 388 | |
| 375 | | The *critera* are as per search(). |
| 376 | | |
| 377 | | Note that this is an extension to the IMAP4: |
| 378 | | http://www.ietf.org/internet-drafts/draft-ietf-imapext-sort-19.txt |
| 379 | | |
| 380 | | XXX needs more detail |
| 381 | | XXX explain charset |
| | 389 | Example values for *sort_criteria* include:: |
| | 390 | |
| | 391 | ARRIVAL |
| | 392 | REVERSE SIZE |
| | 393 | SUBJECT |
| | 394 | |
| | 395 | The *criteria* argument is as per search(). |
| | 396 | See `RFC-5256 <http://tools.ietf.org/html/rfc5256>`_ for full details. |
| | 397 | |
| | 398 | Note that SORT is an extension to the IMAP4 standard so it may |
| | 399 | not be supported by all IMAP servers. |
| 382 | 400 | """ |
| 383 | 401 | if not criteria: |
| … |
… |
|
| 401 | 419 | self._checkok('sort', typ, data) |
| 402 | 420 | |
| 403 | | return [ long(i) for i in data[0].split() ] |
| | 421 | return [long(i) for i in data[0].split()] |
| 404 | 422 | |
| 405 | 423 | |
| 406 | 424 | def get_flags(self, messages): |
| 407 | | """Returns the flags set for each message in *messages* as a |
| 408 | | dictionary structured like this: |
| 409 | | ``{ msgid1: [flag1, flag2, ... ], }``. |
| | 425 | """Return the flags set for each message in *messages*. |
| | 426 | |
| | 427 | The return value is a dictionary structured like this: ``{ |
| | 428 | msgid1: [flag1, flag2, ... ], }``. |
| 410 | 429 | """ |
| 411 | 430 | response = self.fetch(messages, ['FLAGS']) |