From: Menno Smits Date: Mon, 27 Jul 2015 23:27:56 +0000 (+1200) Subject: Fixed bad merge X-Git-Tag: 1.0.0~1^2~59 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=89e2ab99a90a8b00a7a383dcf9e176491fd628ad;p=imapclient.git Fixed bad merge --- diff --git a/imapclient/imapclient.py b/imapclient/imapclient.py index 46a5d79..300c021 100644 --- a/imapclient/imapclient.py +++ b/imapclient/imapclient.py @@ -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*. diff --git a/imapclient/response_parser.py b/imapclient/response_parser.py index 0bc15fb..fc7d8a8 100644 --- a/imapclient/response_parser.py +++ b/imapclient/response_parser.py @@ -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: