From: Menno Smits Date: Tue, 7 Jul 2015 05:53:46 +0000 (+1200) Subject: Resynced to trunk X-Git-Tag: 1.0.0~1^2~57^2~15 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=e7d8b30763c65f705f67bf907e59a1e79bccf74e;p=imapclient.git Resynced to trunk --- e7d8b30763c65f705f67bf907e59a1e79bccf74e diff --cc .hgignore index a3fe99d,96b6b40..7f5ed79 --- a/.hgignore +++ b/.hgignore @@@ -9,3 -8,5 +9,4 @@@ doc/html ^setuptools-.+ ^unittest2-.+ ^six-.+ -^argparse-.+\.egg$ + ^.eggs/ diff --cc imapclient/imapclient.py index be1b290,705d418..7208a94 --- a/imapclient/imapclient.py +++ b/imapclient/imapclient.py @@@ -20,9 -20,8 +21,9 @@@ except ImportError oauth_module = None from . import response_lexer +from . import tls + from .datetime_util import datetime_to_INTERNALDATE from .imap_utf7 import encode as encode_utf7, decode as decode_utf7 - from .fixed_offset import FixedOffset from .response_types import SearchIds from .six import moves, iteritems, text_type, integer_types, PY3, binary_type, string_types xrange = moves.xrange @@@ -41,12 -41,15 +42,18 @@@ if 'XLIST' not in imaplib.Commands # ...and IDLE if 'IDLE' not in imaplib.Commands: - imaplib.Commands['IDLE'] = imaplib.Commands['APPEND'] + imaplib.Commands['IDLE'] = imaplib.Commands['APPEND'] +# ..and STARTTLS +if 'STARTTLS' not in imaplib.Commands: + imaplib.Commands['STARTTLS'] = ('NONAUTH',) -# and ID. RFC2971 says that this command is valid in all states, but not that -# some servers (*cough* FastMail *cough*) don't seem to accept it in state -# NONAUTH. ++# ...and ID. RFC2971 says that this command is valid in all states, ++# but not that some servers (*cough* FastMail *cough*) don't seem to ++# accept it in state NONAUTH. + if 'ID' not in imaplib.Commands: + imaplib.Commands['ID'] = ('NONAUTH', 'AUTH', 'SELECTED') + # System flags DELETED = r'\Deleted' @@@ -303,20 -294,24 +333,24 @@@ class IMAPClient(object) """Get a listing of folders on the server as a list of ``(flags, delimiter, name)`` tuples. - Calling list_folders with no arguments will list all - folders. + Specifying *directory* will limit returned folders to the + given base directory. The directory and any child directories + will returned. - Specifying *directory* will limit returned folders to that - base directory. Specifying *pattern* will limit returned - folders to those with matching names. The wildcards are - supported in *pattern*. ``*`` matches zero or more of any - character and ``%`` matches 0 or more characters except the - folder delimiter. + Specifying *pattern* will limit returned folders to those with + matching names. The wildcards are supported in + *pattern*. ``*`` matches zero or more of any character and + ``%`` matches 0 or more characters except the folder + delimiter. - Folder names are always returned as unicode strings, and decoded from - modifier utf-7, except if folder_decode is not set. + Calling list_folders with no arguments will recursively list + all folders available for the logged in user. + + Folder names are always returned as unicode strings, and + decoded from modified UTF-7, except if folder_decode is not + set. """ - return self._do_list('LIST', directory, pattern) + return self._do_list(b'LIST', directory, pattern) def xlist_folders(self, directory="", pattern="*"): """Execute the XLIST command, returning ``(flags, delimiter,