chrome/test/chromedriver/log_replay/client_replay.py
def _GetPayloadString(self, header_line):
    """Gets the payload for the current command in self._logfile.

    Parses the given header line, along with any additional lines as
    applicable, to get a complete JSON payload object from the current
    command in the log file. Note that the payload can be JSON, and error
    (just a string), or something else like an int or a boolean.

    Args:
      header_line: the first line of this command
    Raises:
      ReplayException: if the JSON appears to be incomplete in the log
    Returns:
      payload of the command as a string
    """
    min_header = 5

    header_segments = header_line.split()
    if len(header_segments) < min_header:
      return None
    payload = " ".join(header_segments[min_header-1:])
    opening_char = header_segments[min_header-1]
    if opening_char == "{":
      closing_char = "}"
    elif opening_char == "[":
      closing_char = "]"
    else:
      return payload  # payload is singular, like "1", "false", or an error

    opening_char_count = (payload.count(opening_char)
                          - payload.count(closing_char))

    while opening_char_count > 0:
      next_line = self._log_file.readline()
      if not next_line:
        # It'd be quite surprising that the log is truncated in the middle of
        # a JSON; far more likely that the parsing failed for some reason.
        raise ReplayException(
            "Reached end of file without reaching end of JSON payload")
      payload += next_line
      opening_char_count += _CountChar(next_line, opening_char,
                                       closing_char)

    return payload
Gets the payload for the current command in self._logfile.

    Parses the given header line, along with any additional lines as
    applicable, to get a complete JSON payload object from the current
    command in the log file. Note that the payload can be JSON, and error
    (just a string), or something else like an int or a boolean.

    Args:
      header_line: the first line of this command
    Raises:
      ReplayException: if the JSON appears to be incomplete in the log
    Returns:
      payload of the command as a string
    
Gets the payload for the current command in self._logfile.
Parses the given header line, along with any additional lines as
applicable, to get a complete JSON payload object from the current
command in the log file. Note that the payload can be JSON, and error
(just a string), or something else like an int or a boolean.
Gets the payload for the current command in self . _logfile . Parses the given header line along with any additional lines as applicable to get a complete JSON payload object from the current command in the log file . Note that the payload can be JSON and error ( just a string ) or something else like an int or a boolean .
def _GetPayloadString(self, header_line):
    min_header = 5
    header_segments = header_line.split()
    if len(header_segments) < min_header:
      return None
    payload = " ".join(header_segments[min_header-1:])
    opening_char = header_segments[min_header-1]
    if opening_char == "{":
      closing_char = "}"
    elif opening_char == "[":
      closing_char = "]"
    else:
      return payload  
    opening_char_count = (payload.count(opening_char)
                          - payload.count(closing_char))
    while opening_char_count > 0:
      next_line = self._log_file.readline()
      if not next_line:
        raise ReplayException(
            "Reached end of file without reaching end of JSON payload")
      payload += next_line
      opening_char_count += _CountChar(next_line, opening_char,
                                       closing_char)
    return payload
def _GetPayloadString ( self , header_line ) : min_header = 5 header_segments = header_line . split ( ) if len ( header_segments ) < min_header : return None payload = " " . join ( header_segments [ min_header - 1 : ] ) opening_char = header_segments [ min_header - 1 ] if opening_char == "{" : closing_char = "}" elif opening_char == "[" : closing_char = "]" else : return payload opening_char_count = ( payload . count ( opening_char ) - payload . count ( closing_char ) ) while opening_char_count > 0 : next_line = self . _log_file . readline ( ) if not next_line : raise ReplayException ( "Reached end of file without reaching end of JSON payload" ) payload += next_line opening_char_count += _CountChar ( next_line , opening_char , closing_char ) return payload
Gets the payload for the current command in self._logfile.
Gets the payload for the current command in self . _logfile .
"""Gets the payload for the current command in self._logfile.

    Parses the given header line, along with any additional lines as
    applicable, to get a complete JSON payload object from the current
    command in the log file. Note that the payload can be JSON, and error
    (just a string), or something else like an int or a boolean.

    Args:
      header_line: the first line of this command
    Raises:
      ReplayException: if the JSON appears to be incomplete in the log
    Returns:
      payload of the command as a string
    """ # payload is singular, like "1", "false", or an error # It'd be quite surprising that the log is truncated in the middle of # a JSON; far more likely that the parsing failed for some reason.
payload of the command as a string
payload of the command as a string
if the JSON appears to be incomplete in the log
if the JSON appears to be incomplete in the log
ReplayException
self
header_line
the first line of this command
the first line of this command