diff options
author | wfjsw <wfjsw@users.noreply.github.com> | 2023-11-11 16:58:26 +0000 |
---|---|---|
committer | wfjsw <wfjsw@users.noreply.github.com> | 2023-11-11 16:58:26 +0000 |
commit | 520e52f846892cc2b207b738b4180fa863c7b38f (patch) | |
tree | 44019c69fcf7cd50a527d8cf4def2c013684b1ac /modules/extensions.py | |
parent | 7af576e745c79a9539e40bc158e695192ae79f25 (diff) | |
download | stable-diffusion-webui-gfx803-520e52f846892cc2b207b738b4180fa863c7b38f.tar.gz stable-diffusion-webui-gfx803-520e52f846892cc2b207b738b4180fa863c7b38f.tar.bz2 stable-diffusion-webui-gfx803-520e52f846892cc2b207b738b4180fa863c7b38f.zip |
allow comma and whitespace as separator
Diffstat (limited to 'modules/extensions.py')
-rw-r--r-- | modules/extensions.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/modules/extensions.py b/modules/extensions.py index 7583a3b0..795af996 100644 --- a/modules/extensions.py +++ b/modules/extensions.py @@ -2,6 +2,7 @@ import configparser import functools
import os
import threading
+import re
from modules import shared, errors, cache, scripts
from modules.gitpython_hack import Repo
@@ -48,7 +49,8 @@ class Extension: config.read(os.path.join(self.path, "sd_webui_metadata.ini"))
return config
except Exception:
- errors.report(f"Error reading sd_webui_metadata.ini for extension {self.canonical_name}.", exc_info=True)
+ errors.report(f"Error reading sd_webui_metadata.ini for extension {self.canonical_name}.",
+ exc_info=True)
return None
def to_dict(self):
@@ -70,6 +72,7 @@ class Extension: self.do_read_info_from_repo()
return self.to_dict()
+
try:
d = cache.cached_data_for_file('extensions-git', self.name, os.path.join(self.path, ".git"), read_from_repo)
self.from_dict(d)
@@ -194,8 +197,8 @@ def list_extensions(): f"The current loading extension will be discarded.", exc_info=False)
continue
- # we want to wash the data to lowercase and remove whitespaces just in case
- requires = [x.strip() for x in requires.lower().split(',')] if requires else []
+ # both "," and " " are accepted as separator
+ requires = list(filter(None, re.split(r"[,\s]+", requires.lower()))) if requires else []
extension_dependency_map[canonical_name] = {
"dirname": extension_dirname,
|