def register_function(self, function, inputs, parameters, outputs, name, description): callable = MethodCallable.from_function(function, inputs, parameters, outputs, self._package) source = self._get_function_source(function) self._register_callable(callable, name, description, source)
def register_markdown(self, markdown_filepath): markdown_filepath = pkg_resources.resource_filename( self._plugin.package, markdown_filepath) callable = MethodCallable.from_markdown(markdown_filepath, self._package) with open(markdown_filepath) as fh: metadata, source = frontmatter.parse(fh.read()) self._register_callable(callable, metadata['name'], metadata['description'], source)