Downloader Runners Python Module

Download runner module.

This module contains two download runners. The first is for downloading from a local directory (works well for testing). The second is for downloading from a remote Pacifica Cartd service.

Additional methods for downloading could be used in the future.

class pacifica.dispatcher.downloader_runners.DownloaderRunner[source]

Abstract downloader class for downloading files.

_abc_cache = <_weakrefset.WeakSet object>
_abc_negative_cache = <_weakrefset.WeakSet object>
_abc_negative_cache_version = 42
_abc_registry = <_weakrefset.WeakSet object>
download(basedir_name: str, files: List[pacifica.dispatcher.models.File] = None, timeout: int = 180) → List[Callable[Dict[str, Any], TextIO]][source]

Abstract download method to define interface for downloading files.

class pacifica.dispatcher.downloader_runners.LocalDownloaderRunner(basedir_name: str)[source]

Local download class.

This class is used for running the handlers on previously downloaded data relative to some base directory.

__init__(basedir_name: str) → None[source]

Save the base directory to the instance of the class.

_abc_cache = <_weakrefset.WeakSet object>
_abc_negative_cache = <_weakrefset.WeakSet object>
_abc_negative_cache_version = 42
_abc_registry = <_weakrefset.WeakSet object>
download(basedir_name: str, files: List[pacifica.dispatcher.models.File] = None, timeout: int = 180) → List[Callable[Dict[str, Any], TextIO]][source]

Download the files locally.

The download base directory may not match the class instance base directory. If that’s the case symlink the files from the instance base directory to the called base directory.

Either case return a list of methods used to open the files.

class pacifica.dispatcher.downloader_runners.RemoteDownloaderRunner(downloader: pacifica.downloader.downloader.Downloader)[source]

Remote download runner class.

This class downloads data from a Pacifica Cartd service to a local directory.

__init__(downloader: pacifica.downloader.downloader.Downloader) → None[source]

Initialize the remote downloader class.

The class is initialized with an instance of the pacifica.downloader.Downloader class.

_abc_cache = <_weakrefset.WeakSet object>
_abc_negative_cache = <_weakrefset.WeakSet object>
_abc_negative_cache_version = 42
_abc_registry = <_weakrefset.WeakSet object>
download(basedir_name: str, files: List[pacifica.dispatcher.models.File] = None, timeout: int = 180) → List[Callable[Dict[str, Any], TextIO]][source]

Download the files using the downloader.

The downloader is used to setup a cart of data from the Cartd service. The downloader used in it’s blocking form, setting up the cart, waiting for it to complete and downloading it.

Once complete a list of methods is returned for opening files.