Changeset 202:269a0c252f9b
- Timestamp:
- 01/27/11 13:55:11 (16 months ago)
- Author:
- Menno Smits <menno@…>
- Branch:
- default
- Message:
-
Support for modifiers in the FETCH command (#62)
- Files:
-
Legend:
- Unmodified
- Added
- Removed
-
|
r194
|
r202
|
|
| | 1 | .. -*-Mode: rst; -*- |
| | 2 | |
| 1 | 3 | ===== |
| 2 | 4 | Dev |
| … |
… |
|
| 51 | 53 | example. |
| 52 | 54 | |
| 53 | | Added NAMESPACE support (#63) |
| 54 | | ----------------------------- |
| | 55 | Added NAMESPACE support (#63) [API CHANGE] |
| | 56 | ------------------------------------------ |
| 55 | 57 | namespace() method added and get_folder_delimiter() has been deprecated. |
| | 58 | |
| | 59 | Added support for FETCH modifiers (#62) [NEW] |
| | 60 | --------------------------------------------- |
| | 61 | The fetch method now takes optional modifiers as the last |
| | 62 | argument. These are required for extensions such as RFC 4551 |
| | 63 | (conditional store). Thanks to Thomas Jost for the patch. |
| 56 | 64 | |
| 57 | 65 | =============== |
-
|
r117
|
r202
|
|
| 18 | 18 | (http://www.voidspace.org.uk/python/mock/) |
| 19 | 19 | |
| 20 | | Mark Hammond <mhammond _AT_ skipinet.com.au) |
| 21 | | Much work related to response parsing. |
| | 20 | Mark Hammond (mhammond _AT_ skipinet.com.au) |
| | 21 | Much work related to response parsing and many bug reports. |
| | 22 | |
| | 23 | Thomas Jost (schnouki _AT_ schnouki.net) |
| | 24 | FETCH modifiers patch. |
| 22 | 25 | |
| 23 | 26 | |
-
|
r201
|
r202
|
|
| 490 | 490 | @param messages: Message IDs to fetch. |
| 491 | 491 | @param parts: A sequence of data items to retrieve. |
| 492 | | @param modifiers: An optional sequence of modifiers. |
| | 492 | @param modifiers: An optional sequence of modifiers (where |
| | 493 | supported by the server, eg. ['CHANGEDSINCE 123']). |
| 493 | 494 | @return: A dictionary indexed by message number. Each item is itself a |
| 494 | 495 | dictionary containing the requested message parts. |
-
|
r198
|
r202
|
|
| 388 | 388 | self.assertTrue(body.startswith('om: Bob Smith')) |
| 389 | 389 | |
| | 390 | |
| | 391 | def test_fetch_modifiers(self): |
| | 392 | # CONDSTORE (RFC 4551) provides a good way to use FETCH |
| | 393 | # modifiers but it isn't commonly available. |
| | 394 | if not self.client.has_capability('CONDSTORE'): |
| | 395 | return self.skipTest("Server doesn't support CONDSTORE") |
| | 396 | |
| | 397 | maxModSeq = int(self.client.select_folder('INBOX')['HIGHESTMODSEQ'][0]) |
| | 398 | self.client.append('INBOX', SIMPLE_MESSAGE) |
| | 399 | msg_id = self.client.search()[0] |
| | 400 | |
| | 401 | resp = self.client.fetch(msg_id, ['FLAGS'], ['CHANGEDSINCE %d' % maxModSeq]) |
| | 402 | msg_info = resp[msg_id] |
| | 403 | self.assertIn('MODSEQ', msg_info) |
| | 404 | |
| | 405 | # Prove that the modifier is actually being used |
| | 406 | resp = self.client.fetch(msg_id, ['FLAGS'], ['CHANGEDSINCE %d' % (maxModSeq + 1)]) |
| | 407 | self.assertFalse(resp) |
| | 408 | |
| | 409 | |
| 390 | 410 | def test_BODYSTRUCTURE(self): |
| 391 | 411 | self.client.select_folder('INBOX') |