shapepipe.utilities.canfar
CANFAR TOOLS.
This module defines methods for managing CANFAR specific actions.
- Author
Samuel Farrens <samuel.farrens@cea.fr>
Martin Kilbinger <martin.kilbinger@cea.fr>
-
exception vosError[source]
Bases: Exception
VOS Error.
Generic error that is raised by the vosHandler.
-
class vosHandler(command)[source]
Bases: object
VOS Handler.
This class manages the use of VOS commands.
- Parameters
command (str) – VOS command name
-
static _check_vos_install()[source]
Check VOS Install.
Check if VOS is correctly installed.
- Raises
ImportError – if vos package cannot be imported
-
property command
Set Command.
This method sets the VOS command property.
- Raises
ValueError – if value is not valid vos command
-
__call__(*args, **kwargs)[source]
Call Method.
This method allows class instances to be called as functions.
- Raises
vosError – if error in vos command occurs
-
download(source, target, verbose=False)[source]
Download.
Download file from vos.
- Parameters
source (str) – source path on vos
target (str) – target path
verbose (bool, optional, default=False) – verbose output if True
- Returns
status – status, True/False or success/failure
- Return type
bool
-
dir_list(path, verbose=False)[source]
Set Directory List.
List content of path on vos.
- Parameters
path (str) – path on vos, starts with ‘vos:cfis/…’
verbose (bool, optional, default=False) – verbose output if True
- Raises
HTTPError, KeyError – if error occurs during vos command
- Returns
vls_out – file or directory at path
- Return type
array of str