Package ProcImap :: Module imaplib2
[hide private]
[frames] | no frames]

Module imaplib2

source code

Threaded IMAP4 client.

Based on RFC 2060 and original imaplib module.

Public classes:   IMAP4
                  IMAP4_SSL
                  IMAP4_stream

Public functions: Internaldate2Time
                  ParseFlags
                  Time2Internaldate


Version: 2.4

Author: Piers Lauder <piers@janeelix.com>

Classes [hide private]
  Request
Private class to represent a request awaiting response.
  IMAP4
Threaded IMAP4 client class.
  IMAP4_SSL
IMAP4 client class over SSL connection
  IMAP4_stream
IMAP4 client class over a stream
  _Authenticator
Private class to provide en/de-coding for base64 authentication conversation.
  _IdleCont
When process is called, server is in IDLE state and will send asynchronous changes.
Functions [hide private]
 
Int2AP(num)
string = Int2AP(num) Return 'num' converted to a string using characters from the set 'A'..'P'
source code
 
Internaldate2Time(resp)
time_tuple = Internaldate2Time(resp) Convert IMAP4 INTERNALDATE to UT.
source code
 
Internaldate2tuple(resp)
time_tuple = Internaldate2Time(resp) Convert IMAP4 INTERNALDATE to UT.
source code
 
Time2Internaldate(date_time)
'"DD-Mmm-YYYY HH:MM:SS +HHMM"' = Time2Internaldate(date_time) Convert 'date_time' to IMAP4 INTERNALDATE representation.
source code
 
ParseFlags(resp)
('flag', ...) = ParseFlags(line) Convert IMAP4 flags response to python tuple.
source code
Variables [hide private]
  __release__ = '2'
  __revision__ = '4'
  __credits__ = '\nAuthentication code contributed by Donn Cave ...
  CRLF = '\r\n'
  Debug = None
  IMAP4_PORT = 143
  IMAP4_SSL_PORT = 993
  IDLE_TIMEOUT_RESPONSE = '* IDLE TIMEOUT'
  IDLE_TIMEOUT = 1740
  AllowedVersions = ('IMAP4REV1', 'IMAP4')
  CMD_VAL_STATES = 0
  CMD_VAL_ASYNC = 1
  Commands = {'APPEND': (('AUTH', 'SELECTED'), False), 'AUTHENTI...
  Mon2num = {'Apr': 4, 'Aug': 8, 'Dec': 12, 'Feb': 2, 'Jan': 1, ...
  InternalDate = re.compile(r'.*INTERNALDATE "(?P<day>[ 0123][0-...
  FLAGS_cre = re.compile(r'.*FLAGS \((?P<flags>[^\)]*)\)')
  AUTH = 'AUTH'
  LOGOUT = 'LOGOUT'
  NONAUTH = 'NONAUTH'
  SELECTED = 'SELECTED'
Variables Details [hide private]

__credits__

Value:
'''
Authentication code contributed by Donn Cave <donn@u.washington.edu> J\
une 1998.
String method conversion by ESR, February 2001.
GET/SETACL contributed by Anthony Baxter <anthony@interlink.com.au> Ap\
ril 2001.
IMAP4_SSL contributed by Tino Lange <Tino.Lange@isg.de> March 2002.
GET/SETQUOTA contributed by Andreas Zeidler <az@kreativkombinat.de> Ju\
...

Commands

Value:
{'APPEND': (('AUTH', 'SELECTED'), False),
 'AUTHENTICATE': (('NONAUTH'), False),
 'CAPABILITY': (('NONAUTH', 'AUTH', 'SELECTED'), True),
 'CHECK': (('SELECTED'), True),
 'CLOSE': (('SELECTED'), False),
 'COPY': (('SELECTED'), True),
 'CREATE': (('AUTH', 'SELECTED'), True),
 'DELETE': (('AUTH', 'SELECTED'), True),
...

Mon2num

Value:
{'Apr': 4,
 'Aug': 8,
 'Dec': 12,
 'Feb': 2,
 'Jan': 1,
 'Jul': 7,
 'Jun': 6,
 'Mar': 3,
...

InternalDate

Value:
re.compile(r'.*INTERNALDATE "(?P<day>[ 0123][0-9])-(?P<mon>[A-Z][a-z][\
a-z])-(?P<year>[0-9][0-9][0-9][0-9]) (?P<hour>[0-9][0-9]):(?P<min>[0-9\
][0-9]):(?P<sec>[0-9][0-9]) (?P<zonen>[-\+])(?P<zoneh>[0-9][0-9])(?P<z\
onem>[0-9][0-9])"')