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

Class LoadLocalPacketWrapper

pymysql/protocol.py:330–349  ·  view source on GitHub ↗

Load Local Packet Wrapper. It uses an existing packet object, and wraps around it, exposing useful variables while still providing access to the original packet objects variables and methods.

Source from the content-addressed store, hash-verified

328
329
330class LoadLocalPacketWrapper:
331 """
332 Load Local Packet Wrapper. It uses an existing packet object, and wraps
333 around it, exposing useful variables while still providing access
334 to the original packet objects variables and methods.
335 """
336
337 def __init__(self, from_packet):
338 if not from_packet.is_load_local_packet():
339 raise ValueError(
340 f"Cannot create '{self.__class__}' object from invalid packet type"
341 )
342
343 self.packet = from_packet
344 self.filename = self.packet.get_all_data()[1:]
345 if DEBUG:
346 print("filename=", self.filename)
347
348 def __getattr__(self, key):
349 return getattr(self.packet, key)

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected