def load_tool(self, tool, tooldir=None): _t = import_tools([tool], tooldir) self.tools.append({"tool": tool, "tooldir": tooldir}) mod = _t[tool] self._tool_modules[tool] = mod if hasattr(mod, "get_builder"): self.builders[tool] = mod.get_builder(self) return mod
def load_tools(self, fid): tools = eval(fid.read()) for t in tools: _t = import_tools([t["tool"]], t["tooldir"]) tool_name = t["tool"] tool_mod = _t[tool_name] if hasattr(tool_mod, "get_builder"): self.builders[tool_name] = tool_mod.get_builder(self) self.tools = tools
def load_tool(self, tool, tooldir=None): _t = import_tools([tool], tooldir) self.tools.append({"tool": tool, "tooldir": tooldir}) mod = _t[tool] self._tool_modules[tool] = mod if hasattr(mod, "get_builder"): self.builders[tool] = mod.get_builder(self) if not hasattr(mod, "configure"): mod.configure = lambda x: None return mod
def load_tools(self, fid): tools = eval(fid.read()) for t in tools: _t = import_tools([t["tool"]], t["tooldir"]) tool_name = t["tool"] tool_mod = _t[tool_name] if hasattr(tool_mod, "get_builder"): self.builders[tool_name] = tool_mod.get_builder(self) # XXX: this is ugly - need to rethinkg tool # initialization/configuration if hasattr(tool_mod, "init"): tool_mod.init() self.tools = tools