Tinche / uapi

https://uapi.threeofwands.com
Apache License 2.0
89 stars 4 forks source link

Summary and Description Transformers not working with incant methods #44

Closed bbezuk closed 1 year ago

bbezuk commented 1 year ago

Currently If I try to use default example for description transformer

def desc_transformer(handler: Callable, name: str) -> str:
    """Use the first line of the docstring as the description."""
    doc = getattr(handler, "__doc__", None)
    if doc is not None:
        return doc.split("\n")[0]
    return None

this will only work if handler is not using incant injection. If it is handler becomes invoke_ method that does not contain original doc