Changeset 200:ed6498330d85
- Timestamp:
- 01/03/11 22:28:12 (17 months ago)
- Author:
- Menno Smits <menno@…>
- Branch:
- default
- Message:
-
Add support for fetch modifiers (#62)
Patch from Thomas Jost Schnouki (schnouki@…).
- Files:
-
Legend:
- Unmodified
- Added
- Removed
-
|
r156
|
r200
|
|
| 459 | 459 | |
| 460 | 460 | |
| 461 | | def fetch(self, messages, parts): |
| | 461 | def fetch(self, messages, parts, modifiers=None): |
| 462 | 462 | """Retrieve selected data items for one or more messages. |
| 463 | 463 | |
| 464 | 464 | @param messages: Message IDs to fetch. |
| 465 | 465 | @param parts: A sequence of data items to retrieve. |
| | 466 | @param modifiers: An optional sequence of modifiers. |
| 466 | 467 | @return: A dictionary indexed by message number. Each item is itself a |
| 467 | 468 | dictionary containing the requested message parts. |
| … |
… |
|
| 474 | 475 | msg_list = messages_to_str(messages) |
| 475 | 476 | parts_list = seq_to_parenlist([p.upper() for p in parts]) |
| | 477 | modifiers_list = None |
| | 478 | if modifiers is not None: |
| | 479 | modifiers_list = seq_to_parenlist([m.upper() for m in modifiers]) |
| 476 | 480 | |
| 477 | 481 | if self.use_uid: |
| 478 | | tag = self._imap._command('UID', 'FETCH', msg_list, parts_list) |
| 479 | | else: |
| 480 | | tag = self._imap._command('FETCH', msg_list, parts_list) |
| | 482 | tag = self._imap._command('UID', 'FETCH', msg_list, parts_list, modifiers_list) |
| | 483 | else: |
| | 484 | tag = self._imap._command('FETCH', msg_list, parts_list, modifiers_list) |
| 481 | 485 | typ, data = self._imap._command_complete('FETCH', tag) |
| 482 | 486 | self._checkok('fetch', typ, data) |