add backwards compatibility --lyco-dir-backcompat option, use that for LyCORIS directory instead of hardcoded value

prevent running preload.py for disabled extensions
This commit is contained in:
AUTOMATIC1111
2023-07-18 20:11:30 +03:00
parent eb7c9b58fc
commit 136c8859a4
7 changed files with 12 additions and 10 deletions

View File

@@ -12,11 +12,12 @@ def load_module(path):
return module
def preload_extensions(extensions_dir, parser):
def preload_extensions(extensions_dir, parser, extension_list=None):
if not os.path.isdir(extensions_dir):
return
for dirname in sorted(os.listdir(extensions_dir)):
extensions = extension_list if extension_list is not None else os.listdir(extensions_dir)
for dirname in sorted(extensions):
preload_script = os.path.join(extensions_dir, dirname, "preload.py")
if not os.path.isfile(preload_script):
continue