Storage¶
Storage prototype
-
class
qarnot.storage.
Storage
[source]¶ Bases:
object
Common architecture for storage providers
-
get_all_files
(output_dir, progress=None)[source]¶ Get all files from the storage.
Parameters: Raises: - qarnot.exceptions.MissingBucketException – the bucket is not on the server
- qarnot.exceptions.QarnotGenericException – API general error, see message for details
- qarnot.exceptions.UnauthorizedException – invalid credentials
Warning
Will override output_dir content.
-
list_files
()[source]¶ List files on the storage.
- … note:
- File object returned must have a key property.
Returns: List of the files on the storage.
-
get_file
(remote, local=None, progress=None)[source]¶ Get a file from the storage. Create needed subfolders.
Parameters: Return type: Returns: The name of the output file.
Raises: ValueError – no such file
-
add_directory
(local, remote)[source]¶ Add a directory to the storage. Does not follow symlinks. File hierarchy is preserved.
Parameters: Raises: IOError – not a valid directory
-
add_file
(local_or_file, remote)[source]¶ Add a local file or a Python File on the storage.
Note
You can also use object[remote] = local
Parameters:
-
delete_file
(remote)[source]¶ Delete a file from the storage.
Parameters: remote (str) – the name of the remote file
-