third_party/blink/tools/blinkpy/style/filereader.py
def _read_lines(self, file_path):
        """Read the file at a path, and return its lines.

        Raises:
          IOError: If the file does not exist or cannot be read.
        """
        # Support the UNIX convention of using "-" for stdin.
        if file_path == '-':
            file = codecs.StreamReaderWriter(sys.stdin,
                                             codecs.getreader('utf8'),
                                             codecs.getwriter('utf8'),
                                             'replace')
        else:
            # We do not open the file with universal newline support
            # (codecs does not support it anyway), so the resulting
            # lines contain trailing "\r" characters if we are reading
            # a file with CRLF endings.
            # FIXME: This should use self.filesystem
            file = codecs.open(file_path, 'r', 'utf8', 'replace')

        try:
            contents = file.read()
        finally:
            file.close()

        lines = contents.split('\n')
        return lines
Read the file at a path, and return its lines.

        Raises:
          IOError: If the file does not exist or cannot be read.
        
Read the file at a path, and return its lines.
Read the file at a path and return its lines .
def _read_lines(self, file_path):
        if file_path == '-':
            file = codecs.StreamReaderWriter(sys.stdin,
                                             codecs.getreader('utf8'),
                                             codecs.getwriter('utf8'),
                                             'replace')
        else:
            file = codecs.open(file_path, 'r', 'utf8', 'replace')
        try:
            contents = file.read()
        finally:
            file.close()
        lines = contents.split('\n')
        return lines
def _read_lines ( self , file_path ) : if file_path == '-' : file = codecs . StreamReaderWriter ( sys . stdin , codecs . getreader ( 'utf8' ) , codecs . getwriter ( 'utf8' ) , 'replace' ) else : file = codecs . open ( file_path , 'r' , 'utf8' , 'replace' ) try : contents = file . read ( ) finally : file . close ( ) lines = contents . split ( '\n' ) return lines
Read the file at a path, and return its lines.
Read the file at a path and return its lines .
"""Read the file at a path, and return its lines.

        Raises:
          IOError: If the file does not exist or cannot be read.
        """ # Support the UNIX convention of using "-" for stdin. # We do not open the file with universal newline support # (codecs does not support it anyway), so the resulting # lines contain trailing "\r" characters if we are reading # a file with CRLF endings. # FIXME: This should use self.filesystem
If the file does not exist or cannot be read.
If the file does not exist or cannot be read .
IOError
self
file_path