MCPcopy Index your code
hub / github.com/python/cpython / __init__

Method __init__

Lib/test/support/smtpd.py:124–161  ·  view source on GitHub ↗
(self, server, conn, addr, data_size_limit=DATA_SIZE_DEFAULT,
                 map=None, enable_SMTPUTF8=False, decode_data=False)

Source from the content-addressed store, hash-verified

122 return self.command_size_limit
123
124 def __init__(self, server, conn, addr, data_size_limit=DATA_SIZE_DEFAULT,
125 map=None, enable_SMTPUTF8=False, decode_data=False):
126 asynchat.async_chat.__init__(self, conn, map=map)
127 self.smtp_server = server
128 self.conn = conn
129 self.addr = addr
130 self.data_size_limit = data_size_limit
131 self.enable_SMTPUTF8 = enable_SMTPUTF8
132 self._decode_data = decode_data
133 if enable_SMTPUTF8 and decode_data:
134 raise ValueError("decode_data and enable_SMTPUTF8 cannot"
135 " be set to True at the same time")
136 if decode_data:
137 self._emptystring = ''
138 self._linesep = '\r\n'
139 self._dotsep = '.'
140 self._newline = NEWLINE
141 else:
142 self._emptystring = b''
143 self._linesep = b'\r\n'
144 self._dotsep = ord(b'.')
145 self._newline = b'\n'
146 self._set_rset_state()
147 self.seen_greeting = ''
148 self.extended_smtp = False
149 self.command_size_limits.clear()
150 self.fqdn = socket.getfqdn()
151 try:
152 self.peer = conn.getpeername()
153 except OSError as err:
154 # a race condition may occur if the other end is closing
155 # before we can get the peername
156 self.close()
157 if err.errno != errno.ENOTCONN:
158 raise
159 return
160 print('Peer:', repr(self.peer), file=DEBUGSTREAM)
161 self.push('220 %s %s' % (self.fqdn, __version__))
162
163 def _set_post_data_state(self):
164 """Reset state variables to their post-DATA state."""

Callers

nothing calls this directly

Calls 6

_set_rset_stateMethod · 0.95
pushMethod · 0.95
__init__Method · 0.45
clearMethod · 0.45
getpeernameMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected