Coverage for src/pyenbc/remote/cloud_transfer.py: 50%
14 statements
« prev ^ index » next coverage.py v6.4.2, created at 2022-07-20 05:47 +0200
« prev ^ index » next coverage.py v6.4.2, created at 2022-07-20 05:47 +0200
1"""
2@file
3@brief Common API for many remote drives
5.. versionadded:: 1.3
6"""
7from pyquickhelper.loghelper import noLOG
10class CloudTransfer:
11 """
12 defines a common API for a remote storage
13 """
15 def __init__(self, user, pwd, fLOG=None):
16 """
17 constructor
19 @param user user name
20 @param pwd password
21 @param fLOG logging function
22 """
23 self._user = user
24 self._pwd = pwd
25 self.fLOG = noLOG if fLOG is None else fLOG
27 def connect(self):
28 """
29 connect
30 """
31 raise NotImplementedError()
33 def close(self):
34 """
35 close the connection
36 """
37 raise NotImplementedError()
39 def upload_data(self, remote_path, data):
40 """
41 upload binary data
43 @param remote_path path on the remote drive
44 @param data bytes
45 @return boolean
46 """
47 raise NotImplementedError()
49 def download_data(self, remote_path):
50 """
51 download binary data
53 @param remote_path path on the remote drive
54 @return data (bytes)
55 """
56 raise NotImplementedError()