From 298ab306721b95846e7787f01aad736a42fddf16 Mon Sep 17 00:00:00 2001 From: miruka Date: Tue, 10 Mar 2020 09:51:51 -0400 Subject: [PATCH] Read theme in app dir if doesn't exist in user dir --- src/backend/backend.py | 1 - src/backend/user_files.py | 9 +++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/backend/backend.py b/src/backend/backend.py index 4ae42dd9..c344f531 100644 --- a/src/backend/backend.py +++ b/src/backend/backend.py @@ -251,7 +251,6 @@ class Backend: ui_state = await self.ui_state.read() history = await self.history.read() theme = await Theme(self, settings["theme"]).read() - print(theme) return (settings, ui_state, history, theme) diff --git a/src/backend/user_files.py b/src/backend/user_files.py index d6b60bf6..5722376d 100644 --- a/src/backend/user_files.py +++ b/src/backend/user_files.py @@ -279,8 +279,13 @@ class Theme(DataFile): @property def path(self) -> Path: - data_dir = Path(self.backend.appdirs.user_data_dir) - return data_dir / "themes" / self.filename + data_dir = Path(self.backend.appdirs.user_data_dir) + user_path = data_dir / "themes" / self.filename + + if not user_path.exists(): + return Path("src") / "themes" / self.filename + + return user_path async def default_data(self) -> str: