Read theme in app dir if doesn't exist in user dir

This commit is contained in:
miruka 2020-03-10 09:51:51 -04:00
parent 264c2ab16b
commit 298ab30672
2 changed files with 7 additions and 3 deletions

View File

@ -251,7 +251,6 @@ class Backend:
ui_state = await self.ui_state.read() ui_state = await self.ui_state.read()
history = await self.history.read() history = await self.history.read()
theme = await Theme(self, settings["theme"]).read() theme = await Theme(self, settings["theme"]).read()
print(theme)
return (settings, ui_state, history, theme) return (settings, ui_state, history, theme)

View File

@ -279,8 +279,13 @@ class Theme(DataFile):
@property @property
def path(self) -> Path: def path(self) -> Path:
data_dir = Path(self.backend.appdirs.user_data_dir) data_dir = Path(self.backend.appdirs.user_data_dir)
return data_dir / "themes" / self.filename 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: async def default_data(self) -> str: