cloud-files 4.27.0__py3-none-any.whl → 6.0.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {cloud_files-4.27.0.dist-info → cloud_files-6.0.0.dist-info}/AUTHORS +1 -0
- {cloud_files-4.27.0.dist-info → cloud_files-6.0.0.dist-info}/METADATA +101 -21
- cloud_files-6.0.0.dist-info/RECORD +27 -0
- {cloud_files-4.27.0.dist-info → cloud_files-6.0.0.dist-info}/WHEEL +1 -1
- cloud_files-6.0.0.dist-info/pbr.json +1 -0
- cloudfiles/cloudfiles.py +548 -78
- cloudfiles/compression.py +8 -3
- cloudfiles/exceptions.py +4 -0
- cloudfiles/gcs.py +7 -3
- cloudfiles/interfaces.py +462 -69
- cloudfiles/lib.py +12 -2
- cloudfiles/monitoring.py +724 -0
- cloudfiles/paths.py +61 -5
- cloudfiles/resumable_tools.py +50 -15
- cloudfiles/scheduler.py +6 -1
- cloudfiles/secrets.py +16 -12
- cloudfiles/test.py +28 -0
- cloudfiles_cli/cloudfiles_cli.py +349 -41
- cloud_files-4.27.0.dist-info/RECORD +0 -26
- cloud_files-4.27.0.dist-info/pbr.json +0 -1
- cloudfiles/buckets.py +0 -10
- {cloud_files-4.27.0.dist-info → cloud_files-6.0.0.dist-info}/LICENSE +0 -0
- {cloud_files-4.27.0.dist-info → cloud_files-6.0.0.dist-info}/entry_points.txt +0 -0
- {cloud_files-4.27.0.dist-info → cloud_files-6.0.0.dist-info}/top_level.txt +0 -0
cloudfiles/lib.py
CHANGED
|
@@ -53,8 +53,11 @@ def mkdir(path):
|
|
|
53
53
|
return path
|
|
54
54
|
|
|
55
55
|
def touch(path):
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
if os.path.exists(path):
|
|
57
|
+
os.utime(path)
|
|
58
|
+
else:
|
|
59
|
+
mkdir(os.path.dirname(path))
|
|
60
|
+
open(path, 'a').close()
|
|
58
61
|
|
|
59
62
|
def nvl(*args):
|
|
60
63
|
"""Return the leftmost argument that is not None."""
|
|
@@ -150,11 +153,18 @@ def decode_crc32c_b64(b64digest):
|
|
|
150
153
|
# !I means network order (big endian) and unsigned int
|
|
151
154
|
return struct.unpack("!I", base64.b64decode(b64digest))[0]
|
|
152
155
|
|
|
156
|
+
def encode_crc32c_b64(binary):
|
|
157
|
+
val = crc32c(binary)
|
|
158
|
+
val = val.to_bytes(4, 'big')
|
|
159
|
+
return base64.b64encode(val)
|
|
160
|
+
|
|
153
161
|
def crc32c(binary):
|
|
154
162
|
"""
|
|
155
163
|
Computes the crc32c of a binary string
|
|
156
164
|
and returns it as an integer.
|
|
157
165
|
"""
|
|
166
|
+
if isinstance(binary, str):
|
|
167
|
+
binary = binary.encode('utf8')
|
|
158
168
|
return crc32clib.crc32c(binary) # an integer
|
|
159
169
|
|
|
160
170
|
def md5(binary, base=64):
|