Back to index

python3.2  3.2.2
Public Member Functions | Public Attributes | Static Public Attributes | Private Member Functions
test.test_imaplib.SimpleIMAPHandler Class Reference
Inheritance diagram for test.test_imaplib.SimpleIMAPHandler:
Inheritance graph
[legend]
Collaboration diagram for test.test_imaplib.SimpleIMAPHandler:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def handle
def cmd_CAPABILITY
def setup
def finish

Public Attributes

 connection
 rfile
 wfile
 request
 client_address
 server

Static Public Attributes

int timeout = 1
int rbufsize = 1
int wbufsize = 0
 disable_nagle_algorithm = False

Private Member Functions

def _send

Detailed Description

Definition at line 71 of file test_imaplib.py.


Member Function Documentation

def test.test_imaplib.SimpleIMAPHandler._send (   self,
  message 
) [private]

Definition at line 75 of file test_imaplib.py.

00075 
00076     def _send(self, message):
00077         if verbose: print("SENT: %r" % message.strip())
00078         self.wfile.write(message)

Here is the caller graph for this function:

def test.test_imaplib.SimpleIMAPHandler.cmd_CAPABILITY (   self,
  tag,
  args 
)

Definition at line 111 of file test_imaplib.py.

00111 
00112     def cmd_CAPABILITY(self, tag, args):
00113         self._send(b'* CAPABILITY IMAP4rev1\r\n')
00114         self._send('{} OK CAPABILITY completed\r\n'.format(tag).encode('ASCII'))
00115 

Here is the call graph for this function:

def socketserver.StreamRequestHandler.finish (   self) [inherited]

Reimplemented from socketserver.BaseRequestHandler.

Reimplemented in test.test_wsgiref.MockHandler.

Definition at line 691 of file socketserver.py.

00691 
00692     def finish(self):
00693         if not self.wfile.closed:
00694             self.wfile.flush()
00695         self.wfile.close()
00696         self.rfile.close()
00697 

Here is the caller graph for this function:

Reimplemented from socketserver.BaseRequestHandler.

Definition at line 79 of file test_imaplib.py.

00079 
00080     def handle(self):
00081         # Send a welcome message.
00082         self._send(b'* OK IMAP4rev1\r\n')
00083         while 1:
00084             # Gather up input until we receive a line terminator or we timeout.
00085             # Accumulate read(1) because it's simpler to handle the differences
00086             # between naked sockets and SSL sockets.
00087             line = b''
00088             while 1:
00089                 try:
00090                     part = self.rfile.read(1)
00091                     if part == b'':
00092                         # Naked sockets return empty strings..
00093                         return
00094                     line += part
00095                 except IOError:
00096                     # ..but SSLSockets throw exceptions.
00097                     return
00098                 if line.endswith(b'\r\n'):
00099                     break
00100 
00101             if verbose: print('GOT: %r' % line.strip())
00102             splitline = line.split()
00103             tag = splitline[0].decode('ASCII')
00104             cmd = splitline[1].decode('ASCII')
00105             args = splitline[2:]
00106 
00107             if hasattr(self, 'cmd_'+cmd):
00108                 getattr(self, 'cmd_'+cmd)(tag, args)
00109             else:
00110                 self._send('{} BAD {} unknown\r\n'.format(tag, cmd).encode('ASCII'))

Here is the call graph for this function:

Here is the caller graph for this function:

def socketserver.StreamRequestHandler.setup (   self) [inherited]

Reimplemented from socketserver.BaseRequestHandler.

Reimplemented in test.test_wsgiref.MockHandler.

Definition at line 681 of file socketserver.py.

00681 
00682     def setup(self):
00683         self.connection = self.request
00684         if self.timeout is not None:
00685             self.connection.settimeout(self.timeout)
00686         if self.disable_nagle_algorithm:
00687             self.connection.setsockopt(socket.IPPROTO_TCP,
00688                                        socket.TCP_NODELAY, True)
00689         self.rfile = self.connection.makefile('rb', self.rbufsize)
00690         self.wfile = self.connection.makefile('wb', self.wbufsize)

Here is the caller graph for this function:


Member Data Documentation

Definition at line 634 of file socketserver.py.

Reimplemented in test.test_wsgiref.MockHandler.

Definition at line 682 of file socketserver.py.

Reimplemented in xmlrpc.server.SimpleXMLRPCRequestHandler.

Definition at line 679 of file socketserver.py.

Reimplemented in http.server.CGIHTTPRequestHandler.

Definition at line 671 of file socketserver.py.

Definition at line 633 of file socketserver.py.

Definition at line 688 of file socketserver.py.

Definition at line 635 of file socketserver.py.

Reimplemented from socketserver.StreamRequestHandler.

Definition at line 73 of file test_imaplib.py.

Reimplemented in xmlrpc.server.SimpleXMLRPCRequestHandler.

Definition at line 672 of file socketserver.py.

Reimplemented in test.test_wsgiref.MockHandler.

Definition at line 689 of file socketserver.py.


The documentation for this class was generated from the following file: