mirror of
https://github.com/vladmandic/automatic
synced 2026-09-20 01:31:13 +02:00
update lora
This commit is contained in:
@@ -725,6 +725,20 @@ def listfiles(dirname):
|
||||
return [file for file in filenames if os.path.isfile(file)]
|
||||
|
||||
|
||||
def walk_files(path, allowed_extensions=None):
|
||||
if not os.path.exists(path):
|
||||
return
|
||||
if allowed_extensions is not None:
|
||||
allowed_extensions = set(allowed_extensions)
|
||||
for root, _dirs, files in os.walk(path):
|
||||
for filename in files:
|
||||
if allowed_extensions is not None:
|
||||
_, ext = os.path.splitext(filename)
|
||||
if ext not in allowed_extensions:
|
||||
continue
|
||||
yield os.path.join(root, filename)
|
||||
|
||||
|
||||
def html_path(filename):
|
||||
return os.path.join(paths.script_path, "html", filename)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user