feat: allow disabling extensions at installation level
This commit is contained in:
+3
-2
@@ -17,14 +17,15 @@ class Extension(NamedTuple):
|
||||
|
||||
|
||||
class ExtensionManager:
|
||||
def __init__(self):
|
||||
def __init__(self, *, disabled: list = []):
|
||||
self._disabled = disabled
|
||||
self._extension_folders: List[str] = [x[1] for x in os.walk(os.path.join(LNBITS_PATH, "extensions"))][0]
|
||||
|
||||
@property
|
||||
def extensions(self) -> List[Extension]:
|
||||
output = []
|
||||
|
||||
for extension in self._extension_folders:
|
||||
for extension in [ext for ext in self._extension_folders if ext not in self._disabled]:
|
||||
try:
|
||||
with open(os.path.join(LNBITS_PATH, "extensions", extension, "config.json")) as json_file:
|
||||
config = json.load(json_file)
|
||||
|
||||
Reference in New Issue
Block a user