]> khamidou — GitHub mirrors - imapclient.git/commitdiff
Fixed bad merge
authorMenno Smits <menno@freshfoo.com>
Mon, 27 Jul 2015 23:27:56 +0000 (11:27 +1200)
committerMenno Smits <menno@freshfoo.com>
Mon, 27 Jul 2015 23:27:56 +0000 (11:27 +1200)
imapclient/imapclient.py
imapclient/response_parser.py

index 46a5d7956e775f5a11925c392dcfaaa06e53749e..300c021e2e9c4f9a6d13c9ee84c5d9af24ed8f4c 100644 (file)
@@ -22,7 +22,7 @@ except ImportError:
 from . import response_lexer
 from .datetime_util import datetime_to_INTERNALDATE
 from .imap_utf7 import encode as encode_utf7, decode as decode_utf7
-from .response_types import SearchIds
+from .response_parser import parse_response, parse_message_list, parse_fetch_response
 from .six import moves, iteritems, text_type, integer_types, PY3, binary_type, string_types
 xrange = moves.xrange
 
@@ -32,7 +32,6 @@ if PY3:
 
 __all__ = ['IMAPClient', 'DELETED', 'SEEN', 'ANSWERED', 'FLAGGED', 'DRAFT', 'RECENT']
 
-from .response_parser import parse_response, parse_message_list, parse_fetch_response
 
 # We also offer the gmail-specific XLIST command...
 if 'XLIST' not in imaplib.Commands:
@@ -654,14 +653,7 @@ class IMAPClient(object):
             typ, data = self._imap.search(charset, *criteria)
 
         self._checkok('search', typ, data)
-
-        ids = SearchIds()
-        for item in parse_response(data):
-            if isinstance(item, int):
-                ids.append(item)
-            elif isinstance(item, tuple) and len(item) == 2 and item[0].lower() == b'modseq':
-                ids.modseq = item[1]
-        return ids
+        return parse_message_list(data)
 
     def thread(self, algorithm='REFERENCES', criteria='ALL', charset='UTF-8'):
         """Return a list of messages threads matching *criteria*.
index 0bc15fb327fce96e6a6ead86de2aa913f694f260..fc7d8a8e494b7666314ca5c2c503c8c0b8deee0d 100644 (file)
@@ -71,7 +71,7 @@ def parse_message_list(data):
 
     ids = SearchIds(int(n) for n in m.group(1).split())
 
-    # Parse any non-numeric part on th end using parse_response (this
+    # Parse any non-numeric part on the end using parse_response (this
     # is likely to be the MODSEQ section).
     extra = data[m.end(1):]
     if extra: