GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing dolphinscheduler.apache.org — How to develop — apache-dolphinscheduler 4.1.0-dev documentation How to developWhen you want to create a new resource plugin, you need to add a new class in the module resources_plugin. The resource plugin class needs to inherit the abstract class ResourcePlugin and implement its abstract method read_file function. The parameter of the __init__ function of ResourcePlugin is the prefix of STR type. You can override this function when necessary. The read_file function parameter of ResourcePlugin is the file suffix of STR type, and its return value is the file content, if it exists and is readable. Example
def __init__(self, prefix: str, *args, **kwargs): super().__init__(prefix, *args, **kwargs)
The file prefix has been initialized in init of the resource plugin. The prefix plus suffix is the absolute path of the file in this resource. 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 |
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |