Home | History | Annotate | Download | only in python2.7

Lines Matching refs:line

215 # maximal line length when calling readline().
230 """Add more field data from a continuation line."""
237 Read header lines up to the entirely blank line that terminates them.
238 The (normally blank) line that ends the headers is skipped, but not
239 included in the returned list. If a non-header line ends the headers,
280 line = self.fp.readline(_MAXLINE + 1)
281 if len(line) > _MAXLINE:
282 raise LineTooLong("header line")
283 if not line:
287 if firstline and line.startswith('From '):
288 self.unixfrom = self.unixfrom + line
291 if headerseen and line[0] in ' \t':
294 # It's a continuation line.
295 hlist.append(line)
296 self.addcontinue(headerseen, line.strip())
298 elif self.iscomment(line):
301 elif self.islast(line):
302 # Note! No pushback here! The delimiter line gets eaten.
304 headerseen = self.isheader(line)
306 # It's a legal header line, save it.
307 hlist.append(line)
308 self.addheader(headerseen, line[len(headerseen)+1:].strip())
311 # It's not a header line; throw it back and stop here.
315 self.status = 'Non-header line where header expected'
318 unread(line)
327 # strict: If true, raise BadStatusLine if the status line can't be
328 # parsed as a valid HTTP/1.0 or 1.1 status line. By default it is
331 # status line will look like an HTTP/0.9 response.
353 # from the Status-Line of the response
365 line = self.fp.readline(_MAXLINE + 1)
366 if len(line) > _MAXLINE:
367 raise LineTooLong("header line")
369 print "reply:", repr(line)
370 if not line:
373 raise BadStatusLine(line)
375 [version, status, reason] = line.split(None, 2)
378 [version, status] = line.split(None, 1)
387 raise BadStatusLine(line)
390 self.fp = LineAndFileWrapper(line, self.fp)
397 raise BadStatusLine(line)
399 raise BadStatusLine(line)
416 raise LineTooLong("header line")
585 line = self.fp.readline(_MAXLINE + 1)
586 if len(line) > _MAXLINE:
588 i = line.find(';')
590 line = line[:i] # strip chunk-extensions
592 chunk_left = int(line, 16)
622 line = self.fp.readline(_MAXLINE + 1)
623 if len(line) > _MAXLINE:
624 raise LineTooLong("trailer line")
625 if not line:
629 if line == '\r\n':
759 line = response.fp.readline(_MAXLINE + 1)
760 if len(line) > _MAXLINE:
761 raise LineTooLong("header line")
762 if not line:
765 if line == '\r\n':
808 """Add a line of output to the current request buffer.
810 Assumes that the line does *not* end with \\r\\n.
946 """Send a request header line to the server.
957 """Indicate that the last header line has been sent to the server.
1134 return -1, e.line, None
1262 def __init__(self, line):
1263 if not line:
1264 line = repr(line)
1265 self.args = line,
1266 self.line = line
1279 # The status-line parsing code calls readline(), which normally
1280 # get the HTTP status line. For a 0.9 response, however, this is
1281 # actually the first line of the body! Clients need to get a
1282 # readable file object that contains that line.
1284 def __init__(self, line, file):
1285 self._line = line
1289 self._line_left = len(line)
1295 # called when the last byte is read from the line. After the