Fixed scripts with simlinks.
This commit is contained in:
@@ -235,6 +235,7 @@ class CommandManager:
|
|||||||
return False
|
return False
|
||||||
command_list = sorted(glob.glob(os.path.join(script_path, "*")))
|
command_list = sorted(glob.glob(os.path.join(script_path, "*")))
|
||||||
sub_command = fenrir_path + "/commands/commands/subprocess.py"
|
sub_command = fenrir_path + "/commands/commands/subprocess.py"
|
||||||
|
path_script_names = set()
|
||||||
for command in command_list:
|
for command in command_list:
|
||||||
try:
|
try:
|
||||||
if not os.path.isfile(command):
|
if not os.path.isfile(command):
|
||||||
@@ -283,7 +284,7 @@ class CommandManager:
|
|||||||
)
|
)
|
||||||
self.env["bindings"][shortcut_key] = command_name
|
self.env["bindings"][shortcut_key] = command_name
|
||||||
self.env["rawBindings"][shortcut_key] = shortcut
|
self.env["rawBindings"][shortcut_key] = shortcut
|
||||||
loaded_script_names.add(script_name)
|
path_script_names.add(script_name)
|
||||||
self.env["runtime"]["DebugManager"].write_debug_out(
|
self.env["runtime"]["DebugManager"].write_debug_out(
|
||||||
"Load script:" + section + "." + command_name,
|
"Load script:" + section + "." + command_name,
|
||||||
debug.DebugLevel.INFO,
|
debug.DebugLevel.INFO,
|
||||||
@@ -297,6 +298,7 @@ class CommandManager:
|
|||||||
str(e), debug.DebugLevel.ERROR
|
str(e), debug.DebugLevel.ERROR
|
||||||
)
|
)
|
||||||
continue
|
continue
|
||||||
|
loaded_script_names.update(path_script_names)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def get_script_name(self, file_name):
|
def get_script_name(self, file_name):
|
||||||
|
|||||||
@@ -5,4 +5,4 @@
|
|||||||
# By Chrys, Storm Dragon, and contributors.
|
# By Chrys, Storm Dragon, and contributors.
|
||||||
|
|
||||||
version = "2026.05.12"
|
version = "2026.05.12"
|
||||||
code_name = "testing"
|
code_name = "master"
|
||||||
|
|||||||
@@ -21,7 +21,10 @@ def build_command_environment(local_path, system_path):
|
|||||||
"KEY_C",
|
"KEY_C",
|
||||||
"KEY_D",
|
"KEY_D",
|
||||||
"KEY_E",
|
"KEY_E",
|
||||||
|
"KEY_SHIFT",
|
||||||
"KEY_SCRIPT",
|
"KEY_SCRIPT",
|
||||||
|
"KEY_U",
|
||||||
|
"KEY_X",
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
@@ -89,6 +92,34 @@ def test_system_scripts_skip_existing_shortcut_bindings(tmp_path):
|
|||||||
assert "SYSTEM_ONLY__-__KEY_E" in commands
|
assert "SYSTEM_ONLY__-__KEY_E" in commands
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.unit
|
||||||
|
def test_same_directory_script_variants_load_multiple_shortcuts(tmp_path):
|
||||||
|
local_path = tmp_path / "local"
|
||||||
|
system_path = tmp_path / "system"
|
||||||
|
local_path.mkdir()
|
||||||
|
system_path.mkdir()
|
||||||
|
write_script(system_path / "musicplayer__-__KEY_SHIFT__+__KEY_U.sh")
|
||||||
|
write_script(system_path / "musicplayer__-__KEY_SHIFT__+__KEY_X.sh")
|
||||||
|
|
||||||
|
env = build_command_environment(local_path, system_path)
|
||||||
|
command_manager = CommandManager()
|
||||||
|
command_manager.env = env
|
||||||
|
|
||||||
|
command_manager.load_script_commands()
|
||||||
|
|
||||||
|
commands = env["commands"]["commands"]
|
||||||
|
assert "MUSICPLAYER__-__KEY_SHIFT__+__KEY_U" in commands
|
||||||
|
assert "MUSICPLAYER__-__KEY_SHIFT__+__KEY_X" in commands
|
||||||
|
assert (
|
||||||
|
env["bindings"][str([1, sorted(["KEY_SCRIPT", "KEY_SHIFT", "KEY_U"])])]
|
||||||
|
== "MUSICPLAYER__-__KEY_SHIFT__+__KEY_U"
|
||||||
|
)
|
||||||
|
assert (
|
||||||
|
env["bindings"][str([1, sorted(["KEY_SCRIPT", "KEY_SHIFT", "KEY_X"])])]
|
||||||
|
== "MUSICPLAYER__-__KEY_SHIFT__+__KEY_X"
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.unit
|
@pytest.mark.unit
|
||||||
def test_sound_theme_resolution_prefers_local_soundpacks(tmp_path):
|
def test_sound_theme_resolution_prefers_local_soundpacks(tmp_path):
|
||||||
manager = SettingsManager()
|
manager = SettingsManager()
|
||||||
|
|||||||
Reference in New Issue
Block a user