Browse Source

potential errors of bool values in config.ini is fixed

pull/678/head
Dr.Lt.Data 6 months ago
parent
commit
772f464af9
  1. 14
      glob/manager_core.py
  2. 6
      prestartup_script.py

14
glob/manager_core.py

@ -23,7 +23,7 @@ sys.path.append(glob_path)
import cm_global import cm_global
from manager_util import * from manager_util import *
version = [2, 32, 4] version = [2, 32, 6]
version_str = f"V{version[0]}.{version[1]}" + (f'.{version[2]}' if len(version) > 2 else '') version_str = f"V{version[0]}.{version[1]}" + (f'.{version[2]}' if len(version) > 2 else '')
comfyui_manager_path = os.path.abspath(os.path.join(os.path.dirname(__file__), '..')) comfyui_manager_path = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
@ -223,15 +223,15 @@ def read_config():
'git_exe': default_conf['git_exe'] if 'git_exe' in default_conf else '', 'git_exe': default_conf['git_exe'] if 'git_exe' in default_conf else '',
'channel_url': default_conf['channel_url'] if 'channel_url' in default_conf else 'https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main', 'channel_url': default_conf['channel_url'] if 'channel_url' in default_conf else 'https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main',
'share_option': default_conf['share_option'] if 'share_option' in default_conf else 'all', 'share_option': default_conf['share_option'] if 'share_option' in default_conf else 'all',
'bypass_ssl': default_conf['bypass_ssl'] if 'bypass_ssl' in default_conf else 'False', 'bypass_ssl': default_conf['bypass_ssl'].lower() == 'true' if 'bypass_ssl' in default_conf else False,
'file_logging': default_conf['file_logging'] if 'file_logging' in default_conf else 'True', 'file_logging': default_conf['file_logging'].lower() == 'true' if 'file_logging' in default_conf else True,
'default_ui': default_conf['default_ui'] if 'default_ui' in default_conf else 'none', 'default_ui': default_conf['default_ui'] if 'default_ui' in default_conf else 'none',
'component_policy': default_conf['component_policy'] if 'component_policy' in default_conf else 'workflow', 'component_policy': default_conf['component_policy'] if 'component_policy' in default_conf else 'workflow',
'double_click_policy': default_conf['double_click_policy'] if 'double_click_policy' in default_conf else 'copy-all', 'double_click_policy': default_conf['double_click_policy'] if 'double_click_policy' in default_conf else 'copy-all',
'windows_selector_event_loop_policy': default_conf['windows_selector_event_loop_policy'] if 'windows_selector_event_loop_policy' in default_conf else 'False', 'windows_selector_event_loop_policy': default_conf['windows_selector_event_loop_policy'].lower() == 'true' if 'windows_selector_event_loop_policy' in default_conf else False,
'model_download_by_agent': default_conf['model_download_by_agent'] if 'model_download_by_agent' in default_conf else 'False', 'model_download_by_agent': default_conf['model_download_by_agent'].lower() == 'true' if 'model_download_by_agent' in default_conf else False,
'downgrade_blacklist': default_conf['downgrade_blacklist'] if 'downgrade_blacklist' in default_conf else '', 'downgrade_blacklist': default_conf['downgrade_blacklist'] if 'downgrade_blacklist' in default_conf else '',
'disable_unsecure_features': default_conf['disable_unsecure_features'] if 'disable_unsecure_features' in default_conf else 'False', 'disable_unsecure_features': default_conf['disable_unsecure_features'].lower() == 'true' if 'disable_unsecure_features' in default_conf else False,
} }
except Exception: except Exception:
@ -1192,4 +1192,4 @@ def unzip(model_path):
def is_unsecure_features_disabled(): def is_unsecure_features_disabled():
return get_config()['disable_unsecure_features'].lower() == 'true' return get_config()['disable_unsecure_features']

6
prestartup_script.py

@ -49,7 +49,7 @@ def check_file_logging():
config.read(config_path) config.read(config_path)
default_conf = config['default'] default_conf = config['default']
if 'file_logging' in default_conf and default_conf['file_logging'].lower() == 'false': if 'file_logging' in default_conf and not default_conf['file_logging']:
enable_file_logging = False enable_file_logging = False
except Exception: except Exception:
pass pass
@ -364,7 +364,7 @@ def check_bypass_ssl():
config.read(config_path) config.read(config_path)
default_conf = config['default'] default_conf = config['default']
if 'bypass_ssl' in default_conf and default_conf['bypass_ssl'].lower() == 'true': if 'bypass_ssl' in default_conf and default_conf['bypass_ssl']:
print(f"[ComfyUI-Manager] WARN: Unsafe - SSL verification bypass option is Enabled. (see ComfyUI-Manager/config.ini)") print(f"[ComfyUI-Manager] WARN: Unsafe - SSL verification bypass option is Enabled. (see ComfyUI-Manager/config.ini)")
ssl._create_default_https_context = ssl._create_unverified_context # SSL certificate error fix. ssl._create_default_https_context = ssl._create_unverified_context # SSL certificate error fix.
except Exception: except Exception:
@ -586,7 +586,7 @@ def check_windows_event_loop_policy():
config.read(config_path) config.read(config_path)
default_conf = config['default'] default_conf = config['default']
if 'windows_selector_event_loop_policy' in default_conf and default_conf['windows_selector_event_loop_policy'].lower() == 'true': if 'windows_selector_event_loop_policy' in default_conf and default_conf['windows_selector_event_loop_policy']:
try: try:
import asyncio import asyncio
import asyncio.windows_events import asyncio.windows_events

Loading…
Cancel
Save