polywrap_uri_resolvers.resolvers.abc.resolver_with_history module
This module contains the ResolverWithHistory abstract class.
- class polywrap_uri_resolvers.resolvers.abc.resolver_with_history.ResolverWithHistory(*args, **kwargs)[source]
Bases:
UriResolverDefines an abstract resolver that tracks its steps in the resolution context.
This is useful for resolvers that doesn’t need to manually track their steps in the resolution context.
- try_resolve_uri(uri: Uri, client: InvokerClient, resolution_context: UriResolutionContext) Uri | UriWrapper | UriPackage[source]
Try to resolve a URI to a wrap package, a wrapper, or a URI and update the resolution context with the result.
This method calls the internal abstract method _tryResolveUri before updating the resolution context. Implementations are expect to place resolution logic in _tryResolveUri.
- Parameters:
uri (Uri) – The URI to resolve.
client (InvokerClient) – The client to use for resolving the URI.
resolution_context (IUriResolutionContext) – The resolution context to update.
- Returns:
The resolved URI package, wrapper, or URI.
- Return type:
UriPackageOrWrapper