cloud-files 5.4.0__py3-none-any.whl → 5.5.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.4.0.dist-info → cloud_files-5.5.0.dist-info}/METADATA +1 -1
- {cloud_files-5.4.0.dist-info → cloud_files-5.5.0.dist-info}/RECORD +13 -13
- cloud_files-5.5.0.dist-info/pbr.json +1 -0
- cloudfiles/cloudfiles.py +1 -2
- cloudfiles/interfaces.py +21 -4
- cloudfiles/scheduler.py +6 -1
- cloudfiles/secrets.py +16 -12
- cloudfiles_cli/cloudfiles_cli.py +1 -1
- cloud_files-5.4.0.dist-info/pbr.json +0 -1
- {cloud_files-5.4.0.dist-info → cloud_files-5.5.0.dist-info}/AUTHORS +0 -0
- {cloud_files-5.4.0.dist-info → cloud_files-5.5.0.dist-info}/LICENSE +0 -0
- {cloud_files-5.4.0.dist-info → cloud_files-5.5.0.dist-info}/WHEEL +0 -0
- {cloud_files-5.4.0.dist-info → cloud_files-5.5.0.dist-info}/entry_points.txt +0 -0
- {cloud_files-5.4.0.dist-info → cloud_files-5.5.0.dist-info}/top_level.txt +0 -0
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
cloudfiles/__init__.py,sha256=pLB4CcV2l3Jgv_ni1520Np1pfzFj8Cpr87vNxFT3rNI,493
|
|
2
|
-
cloudfiles/cloudfiles.py,sha256=
|
|
2
|
+
cloudfiles/cloudfiles.py,sha256=nUIW-SDyeldvmUu_SETJXS4x38Nv3Kj7TBwMwLQhjns,51196
|
|
3
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
|
|
7
|
-
cloudfiles/interfaces.py,sha256=
|
|
7
|
+
cloudfiles/interfaces.py,sha256=3_ybsCKf74DPpI5Vv-BwFLLzc1cLUMfZLBtIKWkfoHQ,44478
|
|
8
8
|
cloudfiles/lib.py,sha256=HHjCvjmOjA0nZWSvHGoSeYpxqd6FAG8xk8LM212LAUA,5382
|
|
9
9
|
cloudfiles/paths.py,sha256=HOvtdLSIYGwlwvnZt9d_Ez3TXOe7WWd18bZNDpExUDQ,12231
|
|
10
10
|
cloudfiles/resumable_tools.py,sha256=NyuSoGh1SaP5akrHCpd9kgy2-JruEWrHW9lvJxV7jpE,6711
|
|
11
|
-
cloudfiles/scheduler.py,sha256=
|
|
12
|
-
cloudfiles/secrets.py,sha256=
|
|
11
|
+
cloudfiles/scheduler.py,sha256=ioqBT5bMPCVHEHlnL-SW_wHulxGgjeThiKHlnaDOydo,3831
|
|
12
|
+
cloudfiles/secrets.py,sha256=IuYKHmmvFmQTyG2Zcmbx7e8U2LIv-woG5d8qyOlyCD8,5431
|
|
13
13
|
cloudfiles/test.py,sha256=jktBhzKLU448QPs5H7QVnTvpYMo4lBBWG1aE7-uzVGQ,678
|
|
14
14
|
cloudfiles/threaded_queue.py,sha256=Nl4vfXhQ6nDLF8PZpSSBpww0M2zWtcd4DLs3W3BArBw,7082
|
|
15
15
|
cloudfiles/typing.py,sha256=f3ZYkNfN9poxhGu5j-P0KCxjCCqSn9HAg5KiIPkjnCg,416
|
|
16
16
|
cloudfiles_cli/LICENSE,sha256=Jna4xYE8CCQmaxjr5Fs-wmUBnIQJ1DGcNn9MMjbkprk,1538
|
|
17
17
|
cloudfiles_cli/__init__.py,sha256=Wftt3R3F21QsHtWqx49ODuqT9zcSr0em7wk48kcH0WM,29
|
|
18
|
-
cloudfiles_cli/cloudfiles_cli.py,sha256=
|
|
19
|
-
cloud_files-5.
|
|
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.
|
|
18
|
+
cloudfiles_cli/cloudfiles_cli.py,sha256=L9xr_z9GCf5PcpmA21Iandim7uMviaLxTZ4Pf1B9Ui0,34865
|
|
19
|
+
cloud_files-5.5.0.dist-info/AUTHORS,sha256=BFVmobgAhaVFI5fqbuqAY5XmBQxe09ZZAsAOTy87hKQ,318
|
|
20
|
+
cloud_files-5.5.0.dist-info/LICENSE,sha256=Jna4xYE8CCQmaxjr5Fs-wmUBnIQJ1DGcNn9MMjbkprk,1538
|
|
21
|
+
cloud_files-5.5.0.dist-info/METADATA,sha256=m3Rlk29z4XnqeLhpKX613g7KMiT-5vGVNsWpjXNfXmU,26970
|
|
22
|
+
cloud_files-5.5.0.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
|
23
|
+
cloud_files-5.5.0.dist-info/entry_points.txt,sha256=xlirb1FVhn1mbcv4IoyMEGumDqKOA4VMVd3drsRQxIg,51
|
|
24
|
+
cloud_files-5.5.0.dist-info/pbr.json,sha256=k1LwgnAaBImOMXKnlbOx2sBAWZ_Jm5AdFAhAugTuvrY,46
|
|
25
|
+
cloud_files-5.5.0.dist-info/top_level.txt,sha256=xPyrST3okJbsmdCF5IC2gYAVxg_aD5AYVTnNo8UuoZU,26
|
|
26
|
+
cloud_files-5.5.0.dist-info/RECORD,,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"git_version": "512949d", "is_release": true}
|
cloudfiles/cloudfiles.py
CHANGED
|
@@ -751,8 +751,7 @@ class CloudFiles:
|
|
|
751
751
|
res = first(self.list(prefix=prefix))
|
|
752
752
|
return res is not None
|
|
753
753
|
except NotImplementedError as err:
|
|
754
|
-
|
|
755
|
-
return res > 0
|
|
754
|
+
return not CloudFile(self.cloudpath).exists()
|
|
756
755
|
|
|
757
756
|
def exists(
|
|
758
757
|
self, paths:GetPathType,
|
cloudfiles/interfaces.py
CHANGED
|
@@ -1497,8 +1497,25 @@ class CaveInterface(HttpInterface):
|
|
|
1497
1497
|
is, don't worry about it.
|
|
1498
1498
|
see: https://github.com/CAVEconnectome
|
|
1499
1499
|
"""
|
|
1500
|
-
def
|
|
1501
|
-
|
|
1500
|
+
def __init__(self, path, secrets=None, **kwargs):
|
|
1501
|
+
super().__init__(path, secrets=secrets, **kwargs)
|
|
1502
|
+
|
|
1503
|
+
secrets = kwargs.get('secrets', None)
|
|
1504
|
+
if secrets is None:
|
|
1505
|
+
secrets = {}
|
|
1506
|
+
|
|
1507
|
+
self._token = secrets.get('token', None)
|
|
1508
|
+
if self._token is None:
|
|
1509
|
+
server = self._path.host.replace("https://", "", 1)
|
|
1510
|
+
server = server.replace("http://", "", 1)
|
|
1511
|
+
self._token = cave_credentials(server)
|
|
1512
|
+
if self._token is not None:
|
|
1513
|
+
self._token = self._token.get('token', None)
|
|
1514
|
+
|
|
1515
|
+
def default_headers(self) -> dict:
|
|
1516
|
+
if self._token is None:
|
|
1517
|
+
return {}
|
|
1518
|
+
|
|
1502
1519
|
return {
|
|
1503
|
-
"Authorization": f"Bearer {
|
|
1504
|
-
}
|
|
1520
|
+
"Authorization": f"Bearer {self._token}",
|
|
1521
|
+
}
|
cloudfiles/scheduler.py
CHANGED
|
@@ -137,7 +137,12 @@ def schedule_jobs(
|
|
|
137
137
|
or (hasattr(fns, "__len__") and len(fns) <= 1)
|
|
138
138
|
):
|
|
139
139
|
return schedule_single_threaded_jobs(fns, progress, total, count_return)
|
|
140
|
-
|
|
140
|
+
|
|
141
|
+
if isinstance(total, int):
|
|
142
|
+
concurrency = min(concurrency, max(total, 1))
|
|
143
|
+
elif hasattr(fns, "__len__"):
|
|
144
|
+
concurrency = min(concurrency, max(len(fns), 1))
|
|
145
|
+
|
|
141
146
|
if green == True or (green is None and gevent.monkey.saved):
|
|
142
147
|
return schedule_green_jobs(fns, concurrency, progress, total, count_return)
|
|
143
148
|
|
cloudfiles/secrets.py
CHANGED
|
@@ -137,23 +137,27 @@ def aws_credentials(bucket = '', service = 'aws', skip_files=False):
|
|
|
137
137
|
AWS_CREDENTIALS_CACHE[service][bucket] = aws_credentials
|
|
138
138
|
return aws_credentials
|
|
139
139
|
|
|
140
|
-
CAVE_CREDENTIALS =
|
|
141
|
-
def cave_credentials():
|
|
140
|
+
CAVE_CREDENTIALS:CredentialCacheType = {}
|
|
141
|
+
def cave_credentials(server = ''):
|
|
142
142
|
global CAVE_CREDENTIALS
|
|
143
|
-
default_file_path = 'cave-secret.json'
|
|
144
|
-
path = secretpath(default_file_path)
|
|
145
143
|
|
|
146
|
-
|
|
147
|
-
|
|
144
|
+
paths = [
|
|
145
|
+
secretpath('cave-secret.json')
|
|
146
|
+
]
|
|
148
147
|
|
|
149
|
-
if
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
CAVE_CREDENTIALS
|
|
148
|
+
if server:
|
|
149
|
+
paths = [ secretpath(f'{server}-cave-secret.json') ] + paths
|
|
150
|
+
|
|
151
|
+
if server in CAVE_CREDENTIALS:
|
|
152
|
+
return CAVE_CREDENTIALS.get(server, None)
|
|
154
153
|
|
|
155
|
-
|
|
154
|
+
for path in paths:
|
|
155
|
+
if os.path.exists(path):
|
|
156
|
+
with open(path, 'rt') as f:
|
|
157
|
+
CAVE_CREDENTIALS[server] = json.loads(f.read())
|
|
158
|
+
break
|
|
156
159
|
|
|
160
|
+
return CAVE_CREDENTIALS.get(server, None)
|
|
157
161
|
|
|
158
162
|
HTTP_CREDENTIALS = None
|
|
159
163
|
def http_credentials():
|
cloudfiles_cli/cloudfiles_cli.py
CHANGED
|
@@ -84,7 +84,7 @@ def license():
|
|
|
84
84
|
@main.command()
|
|
85
85
|
@click.option('--shortpath', is_flag=True, default=False, help='Don\'t print the common base path for each listed path.',show_default=True)
|
|
86
86
|
@click.option('--flat', is_flag=True, default=False, help='Only produce a single level of directory hierarchy.',show_default=True)
|
|
87
|
-
@click.option('-e','--expr',is_flag=True, default=False, help='Use a limited regexp language (e.g. [abc123]
|
|
87
|
+
@click.option('-e','--expr',is_flag=True, default=False, help=r'Use a limited regexp language (e.g. [abc123]{3}) to generate prefixes.', show_default=True)
|
|
88
88
|
@click.option('--no-auth',is_flag=True, default=False, help='Uses the http API for read-only operations.', show_default=True)
|
|
89
89
|
@click.argument("cloudpath")
|
|
90
90
|
def ls(shortpath, flat, expr, cloudpath, no_auth):
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"git_version": "002c3fc", "is_release": true}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|