mirror of
https://gitlab.com/wgp/dougal/software.git
synced 2025-12-06 10:27:09 +00:00
Replace Python globbing library.
This was motivated by the need to recurse down paths.
This commit is contained in:
@@ -9,7 +9,7 @@ database.
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
import os
|
import os
|
||||||
from glob import glob
|
import pathlib
|
||||||
import re
|
import re
|
||||||
import configuration
|
import configuration
|
||||||
import p111
|
import p111
|
||||||
@@ -43,8 +43,8 @@ if __name__ == '__main__':
|
|||||||
print(f"Path prefix: {fileprefix}")
|
print(f"Path prefix: {fileprefix}")
|
||||||
|
|
||||||
for globspec in final_p111["globs"]:
|
for globspec in final_p111["globs"]:
|
||||||
fullglob = os.path.join(fileprefix, globspec)
|
for filepath in pathlib.Path(fileprefix).glob(globspec):
|
||||||
for filepath in glob(fullglob):
|
filepath = str(filepath)
|
||||||
print(f"Found {filepath}")
|
print(f"Found {filepath}")
|
||||||
|
|
||||||
if not db.file_in_db(filepath):
|
if not db.file_in_db(filepath):
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ database.
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
import os
|
import os
|
||||||
from glob import glob
|
import pathlib
|
||||||
import re
|
import re
|
||||||
import configuration
|
import configuration
|
||||||
import p190
|
import p190
|
||||||
@@ -43,8 +43,8 @@ if __name__ == '__main__':
|
|||||||
print(f"Path prefix: {fileprefix}")
|
print(f"Path prefix: {fileprefix}")
|
||||||
|
|
||||||
for globspec in final_p190["globs"]:
|
for globspec in final_p190["globs"]:
|
||||||
fullglob = os.path.join(fileprefix, globspec)
|
for filepath in pathlib.Path(fileprefix).glob(globspec):
|
||||||
for filepath in glob(fullglob):
|
filepath = str(filepath)
|
||||||
print(f"Found {filepath}")
|
print(f"Found {filepath}")
|
||||||
|
|
||||||
if not db.file_in_db(filepath):
|
if not db.file_in_db(filepath):
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ database.
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
import os
|
import os
|
||||||
from glob import glob
|
import pathlib
|
||||||
import re
|
import re
|
||||||
import configuration
|
import configuration
|
||||||
import p111
|
import p111
|
||||||
@@ -43,8 +43,8 @@ if __name__ == '__main__':
|
|||||||
print(f"Path prefix: {fileprefix}")
|
print(f"Path prefix: {fileprefix}")
|
||||||
|
|
||||||
for globspec in raw_p111["globs"]:
|
for globspec in raw_p111["globs"]:
|
||||||
fullglob = os.path.join(fileprefix, globspec)
|
for filepath in pathlib.Path(fileprefix).glob(globspec):
|
||||||
for filepath in glob(fullglob):
|
filepath = str(filepath)
|
||||||
print(f"Found {filepath}")
|
print(f"Found {filepath}")
|
||||||
|
|
||||||
if not db.file_in_db(filepath):
|
if not db.file_in_db(filepath):
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ database.
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
import os
|
import os
|
||||||
from glob import glob
|
import pathlib
|
||||||
import re
|
import re
|
||||||
import configuration
|
import configuration
|
||||||
import p190
|
import p190
|
||||||
@@ -43,8 +43,8 @@ if __name__ == '__main__':
|
|||||||
print(f"Path prefix: {fileprefix}")
|
print(f"Path prefix: {fileprefix}")
|
||||||
|
|
||||||
for globspec in raw_p190["globs"]:
|
for globspec in raw_p190["globs"]:
|
||||||
fullglob = os.path.join(fileprefix, globspec)
|
for filepath in pathlib.Path(fileprefix).glob(globspec):
|
||||||
for filepath in glob(fullglob):
|
filepath = str(filepath)
|
||||||
print(f"Found {filepath}")
|
print(f"Found {filepath}")
|
||||||
|
|
||||||
if not db.file_in_db(filepath):
|
if not db.file_in_db(filepath):
|
||||||
|
|||||||
Reference in New Issue
Block a user