Reorder functions

This commit is contained in:
oobabooga 2023-02-23 14:49:02 -03:00
parent 7224343a70
commit 2048b403a5

View File

@ -4,6 +4,16 @@ import modules.shared as shared
extension_state = {}
available_extensions = []
def load_extensions():
global extension_state
for i,ext in enumerate(shared.args.extensions.split(',')):
if ext in available_extensions:
print(f'Loading the extension "{ext}"... ', end='')
ext_string = f"extensions.{ext}.script"
exec(f"import {ext_string}")
extension_state[ext] = [True, i]
print(f'Ok.')
def apply_extensions(text, typ):
for ext in sorted(extension_state, key=lambda x : extension_state[x][1]):
if extension_state[ext][0] == True:
@ -26,15 +36,5 @@ def update_extensions_parameters(*kwargs):
params[param] = eval(f"kwargs[{i}]")
i += 1
def load_extensions():
global extension_state
for i,ext in enumerate(shared.args.extensions.split(',')):
if ext in available_extensions:
print(f'Loading the extension "{ext}"... ', end='')
ext_string = f"extensions.{ext}.script"
exec(f"import {ext_string}")
extension_state[ext] = [True, i]
print(f'Ok.')
def get_params(name):
return eval(f"extensions.{name}.script.params")