cloud-files 5.6.1__py3-none-any.whl → 5.7.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-5.6.1.dist-info → cloud_files-5.7.0.dist-info}/METADATA +1 -1
- {cloud_files-5.6.1.dist-info → cloud_files-5.7.0.dist-info}/RECORD +9 -9
- cloud_files-5.7.0.dist-info/pbr.json +1 -0
- cloudfiles_cli/cloudfiles_cli.py +31 -8
- cloud_files-5.6.1.dist-info/pbr.json +0 -1
- {cloud_files-5.6.1.dist-info → cloud_files-5.7.0.dist-info}/AUTHORS +0 -0
- {cloud_files-5.6.1.dist-info → cloud_files-5.7.0.dist-info}/LICENSE +0 -0
- {cloud_files-5.6.1.dist-info → cloud_files-5.7.0.dist-info}/WHEEL +0 -0
- {cloud_files-5.6.1.dist-info → cloud_files-5.7.0.dist-info}/entry_points.txt +0 -0
- {cloud_files-5.6.1.dist-info → cloud_files-5.7.0.dist-info}/top_level.txt +0 -0
|
@@ -16,12 +16,12 @@ cloudfiles/threaded_queue.py,sha256=Nl4vfXhQ6nDLF8PZpSSBpww0M2zWtcd4DLs3W3BArBw,
|
|
|
16
16
|
cloudfiles/typing.py,sha256=f3ZYkNfN9poxhGu5j-P0KCxjCCqSn9HAg5KiIPkjnCg,416
|
|
17
17
|
cloudfiles_cli/LICENSE,sha256=Jna4xYE8CCQmaxjr5Fs-wmUBnIQJ1DGcNn9MMjbkprk,1538
|
|
18
18
|
cloudfiles_cli/__init__.py,sha256=Wftt3R3F21QsHtWqx49ODuqT9zcSr0em7wk48kcH0WM,29
|
|
19
|
-
cloudfiles_cli/cloudfiles_cli.py,sha256=
|
|
20
|
-
cloud_files-5.
|
|
21
|
-
cloud_files-5.
|
|
22
|
-
cloud_files-5.
|
|
23
|
-
cloud_files-5.
|
|
24
|
-
cloud_files-5.
|
|
25
|
-
cloud_files-5.
|
|
26
|
-
cloud_files-5.
|
|
27
|
-
cloud_files-5.
|
|
19
|
+
cloudfiles_cli/cloudfiles_cli.py,sha256=k5_bMUcjDM2o-HjgwSaK6rT51t91nYjSAy3xZHf-qSs,38128
|
|
20
|
+
cloud_files-5.7.0.dist-info/AUTHORS,sha256=BFVmobgAhaVFI5fqbuqAY5XmBQxe09ZZAsAOTy87hKQ,318
|
|
21
|
+
cloud_files-5.7.0.dist-info/LICENSE,sha256=Jna4xYE8CCQmaxjr5Fs-wmUBnIQJ1DGcNn9MMjbkprk,1538
|
|
22
|
+
cloud_files-5.7.0.dist-info/METADATA,sha256=oiedYRc-OIb1u8yRqMKOOKtvEJHj5phtQd-0V-cEqfI,30530
|
|
23
|
+
cloud_files-5.7.0.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
|
24
|
+
cloud_files-5.7.0.dist-info/entry_points.txt,sha256=xlirb1FVhn1mbcv4IoyMEGumDqKOA4VMVd3drsRQxIg,51
|
|
25
|
+
cloud_files-5.7.0.dist-info/pbr.json,sha256=btfjSn_FM-LMcr5pxgz5jRJ_ImTfyOwfBZgFRavgNP8,46
|
|
26
|
+
cloud_files-5.7.0.dist-info/top_level.txt,sha256=xPyrST3okJbsmdCF5IC2gYAVxg_aD5AYVTnNo8UuoZU,26
|
|
27
|
+
cloud_files-5.7.0.dist-info/RECORD,,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"git_version": "cab2668", "is_release": true}
|
cloudfiles_cli/cloudfiles_cli.py
CHANGED
|
@@ -97,7 +97,7 @@ def ls(shortpath, flat, expr, cloudpath, no_auth):
|
|
|
97
97
|
if no_auth and 's3://' not in cloudpath:
|
|
98
98
|
cloudpath = cloudfiles.paths.to_https_protocol(cloudpath)
|
|
99
99
|
|
|
100
|
-
_, flt, prefix = get_mfp(cloudpath, True)
|
|
100
|
+
_, flt, prefix, suffix = get_mfp(cloudpath, True)
|
|
101
101
|
epath = extract(cloudpath)
|
|
102
102
|
if len(epath.path) > 0:
|
|
103
103
|
if prefix == "" and flt == False:
|
|
@@ -128,6 +128,10 @@ def ls(shortpath, flat, expr, cloudpath, no_auth):
|
|
|
128
128
|
iterables = [ cf.list(prefix=prefix, flat=flat) ]
|
|
129
129
|
|
|
130
130
|
iterables = itertools.chain(*iterables)
|
|
131
|
+
|
|
132
|
+
if suffix:
|
|
133
|
+
iterables = ( x for x in iterables if x.endswith(suffix) )
|
|
134
|
+
|
|
131
135
|
for pathset in sip(iterables, 1000):
|
|
132
136
|
if not shortpath:
|
|
133
137
|
pathset = [ cloudpathjoin(cloudpath, pth) for pth in pathset ]
|
|
@@ -152,6 +156,7 @@ def exprgen(prefix, matches):
|
|
|
152
156
|
|
|
153
157
|
return finished_prefixes
|
|
154
158
|
|
|
159
|
+
SUFFIX_REGEXP = re.compile(r'\*([\w\d\-\._]+)$')
|
|
155
160
|
|
|
156
161
|
def get_mfp(path, recursive):
|
|
157
162
|
"""many,flat,prefix"""
|
|
@@ -159,6 +164,13 @@ def get_mfp(path, recursive):
|
|
|
159
164
|
flat = not recursive
|
|
160
165
|
many = recursive
|
|
161
166
|
prefix = ""
|
|
167
|
+
suffix = ""
|
|
168
|
+
|
|
169
|
+
matches = SUFFIX_REGEXP.search(path)
|
|
170
|
+
if matches is not None:
|
|
171
|
+
suffix = matches.groups()[0]
|
|
172
|
+
path = path.removesuffix(suffix)
|
|
173
|
+
|
|
162
174
|
if path[-2:] == "**":
|
|
163
175
|
many = True
|
|
164
176
|
flat = False
|
|
@@ -168,7 +180,7 @@ def get_mfp(path, recursive):
|
|
|
168
180
|
flat = True
|
|
169
181
|
prefix = os.path.basename(path[:-1])
|
|
170
182
|
|
|
171
|
-
return (many, flat, prefix)
|
|
183
|
+
return (many, flat, prefix, suffix)
|
|
172
184
|
|
|
173
185
|
@main.command()
|
|
174
186
|
@click.argument("source", nargs=-1)
|
|
@@ -267,7 +279,7 @@ def _cp_single(
|
|
|
267
279
|
|
|
268
280
|
# The else clause here is to handle single file transfers
|
|
269
281
|
srcpath = nsrc if issrcdir else os.path.dirname(nsrc)
|
|
270
|
-
many, flat, prefix = get_mfp(nsrc, recursive)
|
|
282
|
+
many, flat, prefix, suffix = get_mfp(nsrc, recursive)
|
|
271
283
|
|
|
272
284
|
if issrcdir and not many:
|
|
273
285
|
print(f"cloudfiles: {source} is a directory (not copied).")
|
|
@@ -302,6 +314,9 @@ def _cp_single(
|
|
|
302
314
|
compression = False
|
|
303
315
|
|
|
304
316
|
if not isinstance(xferpaths, str):
|
|
317
|
+
if suffix:
|
|
318
|
+
xferpaths = ( x for x in xferpaths if x.endswith(suffix) )
|
|
319
|
+
|
|
305
320
|
if parallel == 1:
|
|
306
321
|
_cp(
|
|
307
322
|
srcpath, destpath, compression,
|
|
@@ -494,7 +509,7 @@ def _mv_single(
|
|
|
494
509
|
|
|
495
510
|
# The else clause here is to handle single file transfers
|
|
496
511
|
srcpath = nsrc if issrcdir else os.path.dirname(nsrc)
|
|
497
|
-
many, flat, prefix = get_mfp(nsrc, recursive)
|
|
512
|
+
many, flat, prefix, suffix = get_mfp(nsrc, recursive)
|
|
498
513
|
|
|
499
514
|
if issrcdir and not many:
|
|
500
515
|
print(f"cloudfiles: {source} is a directory (not copied).")
|
|
@@ -524,6 +539,9 @@ def _mv_single(
|
|
|
524
539
|
return
|
|
525
540
|
|
|
526
541
|
if not isinstance(xferpaths, str):
|
|
542
|
+
if suffix:
|
|
543
|
+
xferpaths = ( x for x in xferpaths if x.endswith(suffix) )
|
|
544
|
+
|
|
527
545
|
if parallel == 1:
|
|
528
546
|
_mv(srcpath, destpath, progress, block_size, part_bytes, no_sign_request, xferpaths)
|
|
529
547
|
return
|
|
@@ -701,7 +719,7 @@ def rm(ctx, paths, recursive, progress, block_size):
|
|
|
701
719
|
singles = []
|
|
702
720
|
multiples = []
|
|
703
721
|
for path in paths:
|
|
704
|
-
many, flat, prefix = get_mfp(path, recursive)
|
|
722
|
+
many, flat, prefix, suffix = get_mfp(path, recursive)
|
|
705
723
|
if ispathdir(path) and not many:
|
|
706
724
|
print(f"cloudfiles: {path}: is a directory.")
|
|
707
725
|
return
|
|
@@ -742,13 +760,15 @@ def _rm_many(path, recursive, progress, parallel, block_size):
|
|
|
742
760
|
isdir = (ispathdir(path) or CloudFiles(npath).isdir())
|
|
743
761
|
recursive = recursive and isdir
|
|
744
762
|
|
|
745
|
-
many, flat, prefix = get_mfp(path, recursive)
|
|
763
|
+
many, flat, prefix, suffix = get_mfp(path, recursive)
|
|
746
764
|
|
|
747
765
|
cfpath = npath if isdir else os.path.dirname(npath)
|
|
748
766
|
xferpaths = os.path.basename(npath)
|
|
749
767
|
|
|
750
768
|
if many:
|
|
751
769
|
xferpaths = CloudFiles(cfpath).list(prefix=prefix, flat=flat)
|
|
770
|
+
if suffix:
|
|
771
|
+
xferpaths = ( x for x in xferpaths if x.endswith(suffix) )
|
|
752
772
|
|
|
753
773
|
if parallel == 1 or not many:
|
|
754
774
|
__rm(cfpath, progress, xferpaths)
|
|
@@ -825,10 +845,13 @@ def head(paths):
|
|
|
825
845
|
for path in paths:
|
|
826
846
|
npath = normalize_path(path)
|
|
827
847
|
npath = re.sub(r'\*+$', '', path)
|
|
828
|
-
many, flat, prefix = get_mfp(path, False)
|
|
848
|
+
many, flat, prefix, suffix = get_mfp(path, False)
|
|
829
849
|
if many:
|
|
830
850
|
cf = CloudFiles(npath)
|
|
831
|
-
|
|
851
|
+
lst = cf.list(prefix=prefix, flat=flat)
|
|
852
|
+
if suffix:
|
|
853
|
+
lst = ( x for x in lst if x.endswith(suffix) )
|
|
854
|
+
res = cf.head(lst)
|
|
832
855
|
results.update(res)
|
|
833
856
|
else:
|
|
834
857
|
cf = CloudFiles(os.path.dirname(npath))
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"git_version": "5554b92", "is_release": true}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|