Tests/scripts/hook_validations/pack_unique_files.py
def _read_file_content(self, file_name):
        """Open & Read a file object's content throw exception if can't"""
        try:
            with io.open(self._get_pack_file_path(file_name), mode="r", encoding="utf-8") as file:
                return file.read()
        except IOError:
            self._add_error('Could not open "{}" file'.format(file_name))
        except ValueError:
            self._add_error('Could not read the contents of "{}" file'.format(file_name))

        return False
Open & Read a file object's content throw exception if can't
Open & Read a file object's content throw exception if can't
Open & Read a file object ' s content throw exception if can ' t
def _read_file_content(self, file_name):
        try:
            with io.open(self._get_pack_file_path(file_name), mode="r", encoding="utf-8") as file:
                return file.read()
        except IOError:
            self._add_error('Could not open "{}" file'.format(file_name))
        except ValueError:
            self._add_error('Could not read the contents of "{}" file'.format(file_name))
        return False
def _read_file_content ( self , file_name ) : try : with io . open ( self . _get_pack_file_path ( file_name ) , mode = "r" , encoding = "utf-8" ) as file : return file . read ( ) except IOError : self . _add_error ( 'Could not open "{}" file' . format ( file_name ) ) except ValueError : self . _add_error ( 'Could not read the contents of "{}" file' . format ( file_name ) ) return False
Open & Read a file object's content throw exception if can't
Open & Read a file object ' s content throw exception if can ' t
"""Open & Read a file object's content throw exception if can't"""
self
file_name