Move update to is_reload status of run_config out of ReloadManager

This commit is contained in:
Grant Sanderson 2024-12-10 14:42:53 -06:00
parent 1d67768a13
commit ae93d8fcc6
2 changed files with 4 additions and 9 deletions

View file

@ -26,7 +26,6 @@ class ReloadManager:
""" """
window = None window = None
is_reload = False
def run(self): def run(self):
""" """
@ -44,10 +43,6 @@ class ReloadManager:
except KeyboardInterrupt: except KeyboardInterrupt:
break break
def note_reload(self):
self.is_reload = True
print("Reloading...")
def retrieve_scenes_and_run(self): def retrieve_scenes_and_run(self):
""" """
Take the global configuration, which is based on CLI arguments, Take the global configuration, which is based on CLI arguments,
@ -58,8 +53,6 @@ class ReloadManager:
scene_config = global_config["scene"] scene_config = global_config["scene"]
run_config = global_config["run"] run_config = global_config["run"]
run_config.update(is_reload=self.is_reload)
# Create or reuse window # Create or reuse window
if run_config["show_in_window"] and not self.window: if run_config["show_in_window"] and not self.window:
self.window = Window(**global_config["window"]) self.window = Window(**global_config["window"])

View file

@ -127,12 +127,14 @@ def reload_scene(embed_line: int | None = None) -> None:
`set_custom_exc` method, we cannot break out of the IPython shell by `set_custom_exc` method, we cannot break out of the IPython shell by
this means. this means.
""" """
run_config = get_global_config()["run"]
run_config["is_reload"] = True
if embed_line: if embed_line:
global_config = get_global_config() run_config["embed_line"] = embed_line
global_config["run"]["embed_line"] = embed_line
shell = get_ipython() shell = get_ipython()
if shell: if shell:
print("Reloading...")
shell.run_line_magic("exit_raise", "") shell.run_line_magic("exit_raise", "")