From 2048b403a50f2a8f20a6ba66819fb579099a1a49 Mon Sep 17 00:00:00 2001 From: oobabooga <112222186+oobabooga@users.noreply.github.com> Date: Thu, 23 Feb 2023 14:49:02 -0300 Subject: [PATCH] Reorder functions --- modules/extensions.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/modules/extensions.py b/modules/extensions.py index 1094fc4d..1a936aa6 100644 --- a/modules/extensions.py +++ b/modules/extensions.py @@ -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")