Pluggdapps

Component system. Web framework. And more ...

asset – A collection of utility library.

Utility functions to parse and locate file assets using asset-specification format.

Module contents

pluggdapps.utils.asset.parse_assetspec(spec, pname)[source]

Parse the asset specification spec in the context of package name pname. If pname is package object, it is resolved as pname.__name__. Return a tuple of (packagename, filename), where packagename is the name of the package relative to which the file asset filename is located.

pluggdapps.utils.asset.asset_spec_from_abspath(abspath, papackages)[source]

Use the dictionary of papackages, gathered during platform boot time by calling package() entrypoint and convert abspath to asset-specification format.

pluggdapps.utils.asset.abspath_from_asset_spec(spec, pname='', relativeto=None)[source]

Convert assert sepcification into absolute path. if pname is supplied, it will be used to parse the asset-spec