elements 3.9.2__tar.gz → 3.9.4__tar.gz
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.
- {elements-3.9.2/elements.egg-info → elements-3.9.4}/PKG-INFO +1 -1
- {elements-3.9.2 → elements-3.9.4}/elements/__init__.py +1 -1
- {elements-3.9.2 → elements-3.9.4}/elements/path.py +9 -4
- {elements-3.9.2 → elements-3.9.4/elements.egg-info}/PKG-INFO +1 -1
- {elements-3.9.2 → elements-3.9.4}/LICENSE +0 -0
- {elements-3.9.2 → elements-3.9.4}/MANIFEST.in +0 -0
- {elements-3.9.2 → elements-3.9.4}/README.md +0 -0
- {elements-3.9.2 → elements-3.9.4}/elements/agg.py +0 -0
- {elements-3.9.2 → elements-3.9.4}/elements/checkpoint.py +0 -0
- {elements-3.9.2 → elements-3.9.4}/elements/config.py +0 -0
- {elements-3.9.2 → elements-3.9.4}/elements/counter.py +0 -0
- {elements-3.9.2 → elements-3.9.4}/elements/flags.py +0 -0
- {elements-3.9.2 → elements-3.9.4}/elements/fps.py +0 -0
- {elements-3.9.2 → elements-3.9.4}/elements/logger.py +0 -0
- {elements-3.9.2 → elements-3.9.4}/elements/plotting.py +0 -0
- {elements-3.9.2 → elements-3.9.4}/elements/printing.py +0 -0
- {elements-3.9.2 → elements-3.9.4}/elements/rwlock.py +0 -0
- {elements-3.9.2 → elements-3.9.4}/elements/space.py +0 -0
- {elements-3.9.2 → elements-3.9.4}/elements/timer.py +0 -0
- {elements-3.9.2 → elements-3.9.4}/elements/tree.py +0 -0
- {elements-3.9.2 → elements-3.9.4}/elements/usage.py +0 -0
- {elements-3.9.2 → elements-3.9.4}/elements/utils.py +0 -0
- {elements-3.9.2 → elements-3.9.4}/elements/uuid.py +0 -0
- {elements-3.9.2 → elements-3.9.4}/elements/when.py +0 -0
- {elements-3.9.2 → elements-3.9.4}/elements.egg-info/SOURCES.txt +0 -0
- {elements-3.9.2 → elements-3.9.4}/elements.egg-info/dependency_links.txt +0 -0
- {elements-3.9.2 → elements-3.9.4}/elements.egg-info/requires.txt +0 -0
- {elements-3.9.2 → elements-3.9.4}/elements.egg-info/top_level.txt +0 -0
- {elements-3.9.2 → elements-3.9.4}/requirements-optional.txt +0 -0
- {elements-3.9.2 → elements-3.9.4}/requirements.txt +0 -0
- {elements-3.9.2 → elements-3.9.4}/setup.cfg +0 -0
- {elements-3.9.2 → elements-3.9.4}/setup.py +0 -0
- {elements-3.9.2 → elements-3.9.4}/tests/test_basics.py +0 -0
- {elements-3.9.2 → elements-3.9.4}/tests/test_checkpoint.py +0 -0
- {elements-3.9.2 → elements-3.9.4}/tests/test_flags.py +0 -0
- {elements-3.9.2 → elements-3.9.4}/tests/test_path.py +0 -0
- {elements-3.9.2 → elements-3.9.4}/tests/test_tree.py +0 -0
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import contextlib
|
|
2
1
|
import fnmatch
|
|
3
2
|
import glob as globlib
|
|
4
3
|
import os
|
|
@@ -282,9 +281,9 @@ class GCSPath(Path):
|
|
|
282
281
|
def open(self, mode='r'):
|
|
283
282
|
assert self.blob, 'is a directory'
|
|
284
283
|
if 'w' in mode:
|
|
285
|
-
return self.blob.open(mode,
|
|
284
|
+
return self.blob.open(mode, ignore_flush=True)
|
|
286
285
|
else:
|
|
287
|
-
return self.blob.open(mode
|
|
286
|
+
return self.blob.open(mode)
|
|
288
287
|
|
|
289
288
|
def read(self, mode='r'):
|
|
290
289
|
assert self.blob, 'is a directory'
|
|
@@ -345,7 +344,8 @@ class GCSPath(Path):
|
|
|
345
344
|
else:
|
|
346
345
|
folders.append(child)
|
|
347
346
|
results = [x.rstrip('/') for x in folders + filenames]
|
|
348
|
-
results =
|
|
347
|
+
results = fnmatch.filter(results, prefix + pattern.rstrip('/'))
|
|
348
|
+
results = sorted(set(results))
|
|
349
349
|
return [type(self)(f'gs://{self.bucket.name}/{x}') for x in results]
|
|
350
350
|
|
|
351
351
|
def exists(self):
|
|
@@ -384,9 +384,14 @@ class GCSPath(Path):
|
|
|
384
384
|
folder.upload_from_string(b'')
|
|
385
385
|
|
|
386
386
|
def remove(self, recursive=False):
|
|
387
|
+
isdir = self.isdir()
|
|
387
388
|
if recursive:
|
|
389
|
+
from google.cloud import storage
|
|
390
|
+
assert isdir
|
|
388
391
|
for child in self.glob('**'):
|
|
389
392
|
child.remove()
|
|
393
|
+
if isdir:
|
|
394
|
+
storage.Blob(self.blob.name + '/', self.bucket).delete()
|
|
390
395
|
else:
|
|
391
396
|
self.blob.delete(self.client)
|
|
392
397
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|