MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / skip_lines

Method skip_lines

tools/python-3.11.9-amd64/Lib/cgi.py:797–817  ·  view source on GitHub ↗

Internal: skip lines until outer boundary if defined.

(self)

Source from the content-addressed store, hash-verified

795 self.__write(odelim + line)
796
797 def skip_lines(self):
798 """Internal: skip lines until outer boundary if defined."""
799 if not self.outerboundary or self.done:
800 return
801 next_boundary = b"--" + self.outerboundary
802 last_boundary = next_boundary + b"--"
803 last_line_lfend = True
804 while True:
805 line = self.fp.readline(1<<16)
806 self.bytes_read += len(line)
807 if not line:
808 self.done = -1
809 break
810 if line.endswith(b"--") and last_line_lfend:
811 strippedline = line.strip()
812 if strippedline == next_boundary:
813 break
814 if strippedline == last_boundary:
815 self.done = 1
816 break
817 last_line_lfend = line.endswith(b'\n')
818
819 def make_file(self):
820 """Overridable: return a readable & writable file.

Callers 3

read_urlencodedMethod · 0.95
read_multiMethod · 0.95
read_singleMethod · 0.95

Calls 3

endswithMethod · 0.80
stripMethod · 0.80
readlineMethod · 0.45

Tested by

no test coverage detected