From 55718ed0acc34400a3fb8e319d53dc36ff756f04 Mon Sep 17 00:00:00 2001 From: sezanzeb <28510156+sezanzeb@users.noreply.github.com> Date: Wed, 16 Oct 2024 22:35:00 +0200 Subject: [PATCH] minor refactor --- inputremapper/gui/data_manager.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/inputremapper/gui/data_manager.py b/inputremapper/gui/data_manager.py index efe751c9e..d63972e4b 100644 --- a/inputremapper/gui/data_manager.py +++ b/inputremapper/gui/data_manager.py @@ -231,7 +231,11 @@ def set_autoload(self, status: bool): def get_newest_group_key(self) -> GroupKey: """group_key of the group with the most recently modified preset.""" paths = [] - for path in glob.glob(os.path.join(glob.escape(PathUtils.get_preset_path()), "*/*.json",)): + pattern = os.path.join( + glob.escape(PathUtils.get_preset_path()), + "*/*.json", + ) + for path in glob.glob(pattern): if self._reader_client.groups.find(key=PathUtils.split_all(path)[-2]): paths.append((path, os.path.getmtime(path))) @@ -249,7 +253,10 @@ def get_newest_preset_name(self) -> Name: paths = [ (path, os.path.getmtime(path)) for path in glob.glob( - os.path.join(glob.escape(PathUtils.get_preset_path(self.active_group.name)), "*.json",) + os.path.join( + glob.escape(PathUtils.get_preset_path(self.active_group.name)), + "*.json", + ) ) ] if not paths: