mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-04-09 09:58:20 -05:00
use pathlib glob
This commit is contained in:
parent
270f8677a7
commit
2b3edbaa46
@ -83,13 +83,10 @@ class Command(BaseCommand):
|
|||||||
self.manifest = json.load(f)
|
self.manifest = json.load(f)
|
||||||
manifest_paths.append(main_manifest_path)
|
manifest_paths.append(main_manifest_path)
|
||||||
|
|
||||||
for root, dirs, files in os.walk(self.source):
|
for file in Path(self.source).glob("**/*-manifest.json"):
|
||||||
for file in files:
|
with open(file) as f:
|
||||||
if file.endswith("-manifest.json"):
|
self.manifest += json.load(f)
|
||||||
doc_manifest_path = os.path.normpath(os.path.join(root, file))
|
manifest_paths.append(file)
|
||||||
with open(doc_manifest_path) as f:
|
|
||||||
self.manifest += json.load(f)
|
|
||||||
manifest_paths.append(doc_manifest_path)
|
|
||||||
|
|
||||||
version_path = os.path.normpath(os.path.join(self.source, "version.json"))
|
version_path = os.path.normpath(os.path.join(self.source, "version.json"))
|
||||||
if os.path.exists(version_path):
|
if os.path.exists(version_path):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user