Skip to content

Commit

Permalink
add cmd_arg --disable-extensions all extra
Browse files Browse the repository at this point in the history
  • Loading branch information
w-e-w committed Aug 4, 2023
1 parent 25004d4 commit d7fde55
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions modules/cmd_args.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,3 +111,4 @@
parser.add_argument('--add-stop-route', action='store_true', help='add /_stop route to stop server')
parser.add_argument('--api-server-stop', action='store_true', help='enable server stop/restart/kill via api')
parser.add_argument('--timeout-keep-alive', type=int, default=30, help='set timeout_keep_alive for uvicorn')
parser.add_argument("--disable-extensions", type=str, help='disable extensions "all"/"extra"', default=None)
8 changes: 4 additions & 4 deletions modules/extensions.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@


def active():
if shared.opts.disable_all_extensions == "all":
if shared.cmd_opts.disable_extensions == "all" or shared.opts.disable_all_extensions == "all":
return []
elif shared.opts.disable_all_extensions == "extra":
elif shared.cmd_opts.disable_extensions == "extra" or shared.opts.disable_all_extensions == "extra":
return [x for x in extensions if x.enabled and x.is_builtin]
else:
return [x for x in extensions if x.enabled]
Expand Down Expand Up @@ -141,9 +141,9 @@ def list_extensions():
if not os.path.isdir(extensions_dir):
return

if shared.opts.disable_all_extensions == "all":
if shared.cmd_opts.disable_extensions == "all" or shared.opts.disable_all_extensions == "all":
print("*** \"Disable all extensions\" option was set, will not load any extensions ***")
elif shared.opts.disable_all_extensions == "extra":
elif shared.cmd_opts.disable_extensions == "extra" or shared.opts.disable_all_extensions == "extra":
print("*** \"Disable all extensions\" option was set, will only load built-in extensions ***")

extension_paths = []
Expand Down
2 changes: 1 addition & 1 deletion modules/ui_extensions.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ def extension_table():
ext_status = ext.status

style = ""
if shared.opts.disable_all_extensions == "extra" and not ext.is_builtin or shared.opts.disable_all_extensions == "all":
if shared.cmd_opts.disable_extensions == "extra" and not ext.is_builtin or shared.opts.disable_all_extensions == "extra" and not ext.is_builtin or shared.cmd_opts.disable_extensions == "all" or shared.opts.disable_all_extensions == "all":
style = STYLE_PRIMARY

version_link = ext.version
Expand Down

0 comments on commit d7fde55

Please sign in to comment.