MCPcopy Create free account
hub / github.com/PyMySQL/PyMySQL / DialogHandler

Class DialogHandler

pymysql/tests/test_connection.py:163–182  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

161 return self.m.get(prompt)
162
163 class DialogHandler:
164 def __init__(self, con):
165 self.con = con
166
167 def authenticate(self, pkt):
168 while True:
169 flag = pkt.read_uint8()
170 # echo = (flag & 0x06) == 0x02
171 last = (flag & 0x01) == 0x01
172 prompt = pkt.read_all()
173
174 if prompt == b"Password, please:":
175 self.con.write_packet(b"stillnotverysecret\0")
176 else:
177 self.con.write_packet(b"no idea what to do with this prompt\0")
178 pkt = self.con._read_packet()
179 pkt.check_error()
180 if pkt.is_ok_packet() or last:
181 break
182 return pkt
183
184 class DefectiveHandler:
185 def __init__(self, con):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected