def read_file()

in src/pydolphinscheduler/resources_plugin/local.py [0:0]


    def read_file(self, suf: str):
        """Get the content of the file.

        The address of the file is the prefix of the resource plugin plus the parameter suf.
        """
        path = Path(self.prefix).joinpath(suf)
        if not path.exists():
            raise PyResPluginException("{} is not found".format(str(path)))
        if not os.access(str(path), os.R_OK):
            raise PyResPluginException(
                "You don't have permission to access {}".format(self.prefix + suf)
            )
        with open(path, "r") as f:
            content = f.read()
        return content