def read_sqls()

in core/lib/hook.py [0:0]


    def read_sqls(self):
        log.debug("Reading {}".format(self.file_path))
        with codecs.open(self.file_path, "r", "utf-8") as fh:
            current_sql = ""
            for line in fh:
                # ignore sql comments
                if line.startswith("--"):
                    continue
                # ignore empty line
                if not line.strip():
                    continue
                if self._is_select is None:
                    if line.startswith("SELECT"):
                        # The first line of expected result is always SELECT
                        # statement
                        self._is_select = True
                        self.critical = True
                        self._sqls.append(line)
                        continue
                    else:
                        self._is_select = False
                if self._is_select:
                    self._expected_lines.append(line.strip())
                else:
                    current_sql += line
                    if line.endswith(";\n"):
                        self._sqls.append(current_sql)
                        current_sql = ""
        log.debug(self._sqls)