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(f"{str(path)} is not found")
        if not os.access(str(path), os.R_OK):
            raise PyResPluginException(
                f"You don't have permission to access {self.prefix + suf}"
            )
        with open(path) as f:
            content = f.read()
        return content