'Resolve the asset spec named as ``spec`` to an object that has the
attributes and methods described in
:class:`pyramid.interfaces.IAssetDescriptor`.
If ``spec`` is an absolute filename
(e.g. ``/path/to/myproject/templates/foo.pt``) or an absolute asset
spec (e.g. ``myproject:templates.foo.pt``), an asset descriptor is
returned without taking into account the ``package`` passed to this
class\' constructor.
If ``spec`` is a *relative* asset specification (an asset
specification without a ``:`` in it, e.g. ``templates/foo.pt``), the
``package`` argument of the constructor is used as the package
portion of the asset spec.  For example:
.. code-block:: python
a = AssetResolver(\'myproject\')
resolver = a.resolve(\'templates/foo.pt\')
print(resolver.abspath())
# -> /path/to/myproject/templates/foo.pt
If the AssetResolver is constructed without a ``package`` argument of
``None``, and a relative asset specification is passed to
``resolve``, an :exc:`ValueError` exception is raised.'

def resolve(self, spec):

    if os.path.isabs(spec):
        return FSAssetDescriptor(spec)
    path = spec
    if (':' in path):
        (package_name, path) = spec.split(':', 1)
    else:
        if (self.package is CALLER_PACKAGE):
            package_name = caller_package().__name__
        else:
            package_name = getattr(self.package, '__name__', None)
        if (package_name is None):
            raise ValueError(('relative    spec    %r    irresolveable    without    package' % (spec,)))
    return PkgResourcesAssetDescriptor(package_name, path)
