announcements: use data path for dev mode

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
Eric Callahan 2024-08-05 05:29:20 -04:00
parent 863d0c1e4b
commit 3a42dac02b
1 changed files with 7 additions and 3 deletions

View File

@ -422,9 +422,13 @@ class RssFeed:
self.etag: Optional[str] = None
self.dev_xml_path: Optional[pathlib.Path] = None
if dev_mode:
res_dir = pathlib.Path(__file__).parent.parent.parent.resolve()
res_path = res_dir.joinpath(".devel/announcement_xml")
self.dev_xml_path = res_path.joinpath(self.xml_file)
data_path = pathlib.Path(self.server.get_app_arg("data_path"))
dev_folder = data_path.joinpath("development/announcements")
dev_folder.mkdir(parents=True, exist_ok=True)
self.dev_xml_path = dev_folder.joinpath(self.xml_file)
logging.info(
f"Announcement Feed {name}: Dev XML path set to {self.dev_xml_path}"
)
async def initialize(self) -> None:
self.etag = await self.database.get_item(