cloud-files 5.1.1__py3-none-any.whl → 5.1.3__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: cloud-files
3
- Version: 5.1.1
3
+ Version: 5.1.3
4
4
  Summary: Fast access to cloud storage and local FS.
5
5
  Home-page: https://github.com/seung-lab/cloud-files/
6
6
  Author: William Silversmith
@@ -1,6 +1,6 @@
1
1
  cloudfiles/__init__.py,sha256=pLB4CcV2l3Jgv_ni1520Np1pfzFj8Cpr87vNxFT3rNI,493
2
2
  cloudfiles/cloudfiles.py,sha256=K8rKzrzDzbi1HjGoPMsXSMFzTbe_KLfDIyk4tRjoGEI,51070
3
- cloudfiles/compression.py,sha256=pqYdpu5vfFv-094BpfZ2pgRjVu7ESM9pAZC09P6E8bY,6150
3
+ cloudfiles/compression.py,sha256=WXJHnoNLJ_NWyoY9ygZmFA2qMou35_9xS5dzF7-2H-M,6262
4
4
  cloudfiles/connectionpools.py,sha256=aL8RiSjRepECfgAFmJcz80aJFKbou7hsbuEgugDKwB8,4814
5
5
  cloudfiles/exceptions.py,sha256=N0oGQNG-St6RvnT8e5p_yC_E61q2kgAe2scwAL0F49c,843
6
6
  cloudfiles/gcs.py,sha256=unqu5KxGKaPq6N4QeHSpCDdtnK1BzPOAerTZ8FLt2_4,3820
@@ -10,16 +10,17 @@ cloudfiles/paths.py,sha256=4B3qWjR2TP8wAYK4NLw-iy2KUn3VNspKp6_Vy4j3I8A,11592
10
10
  cloudfiles/resumable_tools.py,sha256=NyuSoGh1SaP5akrHCpd9kgy2-JruEWrHW9lvJxV7jpE,6711
11
11
  cloudfiles/scheduler.py,sha256=DqDANmOpB3NdzFgJDNMMibRIkCrXQqIh2XGL8GWoc9c,3668
12
12
  cloudfiles/secrets.py,sha256=791b5a8nWSBYtlleGzKeoYIR5jl-FI1bw6INRM4Wy-0,5295
13
+ cloudfiles/test.py,sha256=jktBhzKLU448QPs5H7QVnTvpYMo4lBBWG1aE7-uzVGQ,678
13
14
  cloudfiles/threaded_queue.py,sha256=Nl4vfXhQ6nDLF8PZpSSBpww0M2zWtcd4DLs3W3BArBw,7082
14
15
  cloudfiles/typing.py,sha256=f3ZYkNfN9poxhGu5j-P0KCxjCCqSn9HAg5KiIPkjnCg,416
15
16
  cloudfiles_cli/LICENSE,sha256=Jna4xYE8CCQmaxjr5Fs-wmUBnIQJ1DGcNn9MMjbkprk,1538
16
17
  cloudfiles_cli/__init__.py,sha256=Wftt3R3F21QsHtWqx49ODuqT9zcSr0em7wk48kcH0WM,29
17
18
  cloudfiles_cli/cloudfiles_cli.py,sha256=_2Amjp3vsdq7vQgF2utD6BJqjOPKXOTjrJyehnlojpQ,34893
18
- cloud_files-5.1.1.dist-info/AUTHORS,sha256=BFVmobgAhaVFI5fqbuqAY5XmBQxe09ZZAsAOTy87hKQ,318
19
- cloud_files-5.1.1.dist-info/LICENSE,sha256=Jna4xYE8CCQmaxjr5Fs-wmUBnIQJ1DGcNn9MMjbkprk,1538
20
- cloud_files-5.1.1.dist-info/METADATA,sha256=BvXLKejFeTRrk-xA-C43tBNwBToAWNb0kc_wArTYFwk,27047
21
- cloud_files-5.1.1.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
22
- cloud_files-5.1.1.dist-info/entry_points.txt,sha256=xlirb1FVhn1mbcv4IoyMEGumDqKOA4VMVd3drsRQxIg,51
23
- cloud_files-5.1.1.dist-info/pbr.json,sha256=0f1MfoUsmR8uufmjDCLBvW5H2ILfcWRnzLTzR_0ufbg,46
24
- cloud_files-5.1.1.dist-info/top_level.txt,sha256=xPyrST3okJbsmdCF5IC2gYAVxg_aD5AYVTnNo8UuoZU,26
25
- cloud_files-5.1.1.dist-info/RECORD,,
19
+ cloud_files-5.1.3.dist-info/AUTHORS,sha256=BFVmobgAhaVFI5fqbuqAY5XmBQxe09ZZAsAOTy87hKQ,318
20
+ cloud_files-5.1.3.dist-info/LICENSE,sha256=Jna4xYE8CCQmaxjr5Fs-wmUBnIQJ1DGcNn9MMjbkprk,1538
21
+ cloud_files-5.1.3.dist-info/METADATA,sha256=A_TQG-p83SU5RibMDyRfKcM4BoC3pcf6IbgEn_inzVw,27047
22
+ cloud_files-5.1.3.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
23
+ cloud_files-5.1.3.dist-info/entry_points.txt,sha256=xlirb1FVhn1mbcv4IoyMEGumDqKOA4VMVd3drsRQxIg,51
24
+ cloud_files-5.1.3.dist-info/pbr.json,sha256=r_OnVuWLj4u5oFTro4Tjb60qKNAK2AAaXCkaI-MB24w,46
25
+ cloud_files-5.1.3.dist-info/top_level.txt,sha256=xPyrST3okJbsmdCF5IC2gYAVxg_aD5AYVTnNo8UuoZU,26
26
+ cloud_files-5.1.3.dist-info/RECORD,,
@@ -0,0 +1 @@
1
+ {"git_version": "894545a", "is_release": true}
cloudfiles/compression.py CHANGED
@@ -171,7 +171,7 @@ def gzip_compress(content, compresslevel=None):
171
171
  compresslevel = 9
172
172
 
173
173
  if deflate:
174
- return deflate.gzip_compress(content, compresslevel)
174
+ return bytes(deflate.gzip_compress(content, compresslevel))
175
175
 
176
176
  stringio = BytesIO()
177
177
  gzip_obj = gzip.GzipFile(mode='wb', fileobj=stringio, compresslevel=compresslevel)
@@ -190,14 +190,19 @@ def gunzip(content):
190
190
  raise DecompressionError('File contains zero bytes.')
191
191
 
192
192
  gzip_magic_numbers = [ 0x1f, 0x8b ]
193
- first_two_bytes = [ byte for byte in bytearray(content)[:2] ]
193
+
194
+ if isinstance(content, (bytes, bytearray)):
195
+ first_two_bytes = list(content[:2])
196
+ else:
197
+ first_two_bytes = [ byte for byte in bytearray(content)[:2] ]
198
+
194
199
  if first_two_bytes != gzip_magic_numbers:
195
200
  raise DecompressionError('File is not in gzip format. Magic numbers {}, {} did not match {}, {}.'.format(
196
201
  hex(first_two_bytes[0]), hex(first_two_bytes[1]), hex(gzip_magic_numbers[0]), hex(gzip_magic_numbers[1])
197
202
  ))
198
203
 
199
204
  if deflate:
200
- return deflate.gzip_decompress(content)
205
+ return bytes(deflate.gzip_decompress(content))
201
206
 
202
207
  stringio = BytesIO(content)
203
208
  with gzip.GzipFile(mode='rb', fileobj=stringio) as gfile:
cloudfiles/test.py ADDED
@@ -0,0 +1,28 @@
1
+ import igneous.task_creation as tc
2
+ import os
3
+ from taskqueue import totask
4
+ import igneous.tasks
5
+
6
+
7
+ def process_task(msg):
8
+ task = totask(msg)
9
+ task.execute()
10
+ return None
11
+
12
+ def submit_tasks():
13
+ paths = [
14
+ "gs://ng_scratch_ranl_7/make_cv_happy/seg/20250403024338",]
15
+ all_tasks = []
16
+ for img_path in paths:
17
+ mip = 0
18
+ num_mips = 2
19
+ tasks = tc.create_downsampling_tasks(img_path,
20
+ fill_missing=False,
21
+ delete_black_uploads=True,
22
+ mip=mip, num_mips=num_mips)
23
+ all_tasks += list(tasks)
24
+ return all_tasks
25
+
26
+ if __name__ == "__main__":
27
+ tasks = submit_tasks()
28
+ process_task(tasks[0])
@@ -1 +0,0 @@
1
- {"git_version": "39ec622", "is_release": true}