minos.cli.templating.fetchers module
- class minos.cli.templating.fetchers.TemplateFetcher(uri, metadata=None)[source]
Bases:
object
Template Fetcher class.
- static fetch_tar(url, path)[source]
Fetch a tar file from the given url and uncompress it onn the given path.
- Parameters
url (
str
) – The url of the tar file.path (
str
) – The location of the uncompressed file.
- Return type
None
- Returns
This method does not return anything.
- classmethod from_name(name, version='v0.3.0')[source]
Build a new instance from name and version.
- Parameters
name (
str
) – The name of the template.version (
str
) – The version of the template.
- Return type
- Returns
A
TemplateFetcher
instance.
- classmethod from_path(path)[source]
Build a new instance from path.
- Parameters
path (
pathlib.Path
) – The path of the template.- Return type
- Returns
A
TemplateFetcher
instance.
- classmethod from_url(url)[source]
Build a new instance from url.
- Parameters
url (
str
) – The url of the template.- Return type
- Returns
A
TemplateFetcher
instance.
- property path: pathlib.Path
Get the local path of the template.
- Return type
pathlib.Path
- Returns
A
Path
instance.
- property tmp: tempfile.TemporaryDirectory
Get the temporal directory in which the template is downloaded.
- Return type
tempfile.TemporaryDirectory
- Returns
A
TemporaryDirectory
instance.