From b83399cef4ad13bd88c43b3d4d115f3184ff79b3 Mon Sep 17 00:00:00 2001 From: Midorica Date: Mon, 26 Feb 2024 18:35:34 -0500 Subject: [PATCH] cxb: hotfix to classic rev --- changelog.md | 5 +++++ titles/cxb/rev.py | 43 ++++++++++++++++++++++++------------------- 2 files changed, 29 insertions(+), 19 deletions(-) diff --git a/changelog.md b/changelog.md index b612583..4a890a3 100644 --- a/changelog.md +++ b/changelog.md @@ -1,6 +1,11 @@ # Changelog Documenting updates to ARTEMiS, to be updated every time the master branch is pushed to. +## 20240226 +### CXB ++ Fixing paths for rev.py ++ Changed encoding for handle_data_item_list_icon_request + ## 20240202 ### SAO + Added reader assets and edited the game specific documentation diff --git a/titles/cxb/rev.py b/titles/cxb/rev.py index 757b7e8..f811721 100644 --- a/titles/cxb/rev.py +++ b/titles/cxb/rev.py @@ -47,7 +47,7 @@ class CxbRev(CxbBase): @cached(lifetime=86400) async def handle_data_music_list_request(self, data: Dict) -> Dict: ret_str = "" - with open(r"titles/cxb/data/rss/MusicArchiveList.csv") as music: + with open(r"titles/cxb/data/rev/MusicArchiveList.csv") as music: lines = music.readlines() for line in lines: line_split = line.split(",") @@ -59,7 +59,7 @@ class CxbRev(CxbBase): async def handle_data_item_list_icon_request(self, data: Dict) -> Dict: ret_str = "\r\n#ItemListIcon\r\n" with open( - r"titles/cxb/data/rss/Item/ItemArchiveList_Icon.csv", encoding="utf-8" + r"titles/cxb/data/rev/Item/ItemArchiveList_Icon.csv", encoding="shift-jis" ) as item: lines = item.readlines() for line in lines: @@ -70,7 +70,7 @@ class CxbRev(CxbBase): async def handle_data_item_list_skin_notes_request(self, data: Dict) -> Dict: ret_str = "\r\n#ItemListSkinNotes\r\n" with open( - r"titles/cxb/data/rss/Item/ItemArchiveList_SkinNotes.csv", encoding="utf-8" + r"titles/cxb/data/rev/Item/ItemArchiveList_SkinNotes.csv", encoding="utf-8" ) as item: lines = item.readlines() for line in lines: @@ -81,7 +81,7 @@ class CxbRev(CxbBase): async def handle_data_item_list_skin_effect_request(self, data: Dict) -> Dict: ret_str = "\r\n#ItemListSkinEffect\r\n" with open( - r"titles/cxb/data/rss/Item/ItemArchiveList_SkinEffect.csv", encoding="utf-8" + r"titles/cxb/data/rev/Item/ItemArchiveList_SkinEffect.csv", encoding="utf-8" ) as item: lines = item.readlines() for line in lines: @@ -92,7 +92,7 @@ class CxbRev(CxbBase): async def handle_data_item_list_skin_bg_request(self, data: Dict) -> Dict: ret_str = "\r\n#ItemListSkinBg\r\n" with open( - r"titles/cxb/data/rss/Item/ItemArchiveList_SkinBg.csv", encoding="utf-8" + r"titles/cxb/data/rev/Item/ItemArchiveList_SkinBg.csv", encoding="utf-8" ) as item: lines = item.readlines() for line in lines: @@ -103,7 +103,7 @@ class CxbRev(CxbBase): async def handle_data_item_list_title_request(self, data: Dict) -> Dict: ret_str = "\r\n#ItemListTitle\r\n" with open( - r"titles/cxb/data/rss/Item/ItemList_Title.csv", encoding="shift-jis" + r"titles/cxb/data/rev/Item/ItemList_Title.csv", encoding="shift-jis" ) as item: lines = item.readlines() for line in lines: @@ -114,7 +114,7 @@ class CxbRev(CxbBase): async def handle_data_shop_list_music_request(self, data: Dict) -> Dict: ret_str = "\r\n#ShopListMusic\r\n" with open( - r"titles/cxb/data/rss/Shop/ShopList_Music.csv", encoding="shift-jis" + r"titles/cxb/data/rev/Shop/ShopList_Music.csv", encoding="shift-jis" ) as shop: lines = shop.readlines() for line in lines: @@ -125,7 +125,7 @@ class CxbRev(CxbBase): async def handle_data_shop_list_icon_request(self, data: Dict) -> Dict: ret_str = "\r\n#ShopListIcon\r\n" with open( - r"titles/cxb/data/rss/Shop/ShopList_Icon.csv", encoding="shift-jis" + r"titles/cxb/data/rev/Shop/ShopList_Icon.csv", encoding="shift-jis" ) as shop: lines = shop.readlines() for line in lines: @@ -136,7 +136,7 @@ class CxbRev(CxbBase): async def handle_data_shop_list_title_request(self, data: Dict) -> Dict: ret_str = "\r\n#ShopListTitle\r\n" with open( - r"titles/cxb/data/rss/Shop/ShopList_Title.csv", encoding="shift-jis" + r"titles/cxb/data/rev/Shop/ShopList_Title.csv", encoding="shift-jis" ) as shop: lines = shop.readlines() for line in lines: @@ -156,7 +156,7 @@ class CxbRev(CxbBase): async def handle_data_shop_list_sale_request(self, data: Dict) -> Dict: ret_str = "\r\n#ShopListSale\r\n" with open( - r"titles/cxb/data/rss/Shop/ShopList_Sale.csv", encoding="shift-jis" + r"titles/cxb/data/rev/Shop/ShopList_Sale.csv", encoding="shift-jis" ) as shop: lines = shop.readlines() for line in lines: @@ -164,14 +164,19 @@ class CxbRev(CxbBase): return {"data": ret_str} async def handle_data_extra_stage_list_request(self, data: Dict) -> Dict: - return {"data": ""} + ret_str = "" + with open(r"titles/cxb/data/rev/ExtraStageList.csv", encoding="shift-jis") as stage: + lines = stage.readlines() + for line in lines: + ret_str += f"{line[:-1]}\r\n" + return {"data": ret_str} @cached(lifetime=86400) async def handle_data_exxxxx_request(self, data: Dict) -> Dict: extra_num = int(data["dldate"]["filetype"][-4:]) ret_str = "" with open( - rf"titles/cxb/data/rss/Ex000{extra_num}.csv", encoding="shift-jis" + rf"titles/cxb/data/rev/Ex000{extra_num}.csv", encoding="shift-jis" ) as stage: lines = stage.readlines() for line in lines: @@ -187,7 +192,7 @@ class CxbRev(CxbBase): @cached(lifetime=86400) async def handle_data_news_list_request(self, data: Dict) -> Dict: ret_str = "" - with open(r"titles/cxb/data/rss/NewsList.csv", encoding="UTF-8") as news: + with open(r"titles/cxb/data/rev/NewsList.csv", encoding="UTF-8") as news: lines = news.readlines() for line in lines: ret_str += f"{line[:-1]}\r\n" @@ -199,7 +204,7 @@ class CxbRev(CxbBase): @cached(lifetime=86400) async def handle_data_license_request(self, data: Dict) -> Dict: ret_str = "" - with open(r"titles/cxb/data/rss/License_Offline.csv", encoding="UTF-8") as lic: + with open(r"titles/cxb/data/rev/License_Offline.csv", encoding="UTF-8") as lic: lines = lic.readlines() for line in lines: ret_str += f"{line[:-1]}\r\n" @@ -209,7 +214,7 @@ class CxbRev(CxbBase): async def handle_data_course_list_request(self, data: Dict) -> Dict: ret_str = "" with open( - r"titles/cxb/data/rss/Course/CourseList.csv", encoding="UTF-8" + r"titles/cxb/data/rev/Course/CourseList.csv", encoding="UTF-8" ) as course: lines = course.readlines() for line in lines: @@ -222,7 +227,7 @@ class CxbRev(CxbBase): extra_num = int(data["dldate"]["filetype"][-4:]) ret_str = "" with open( - rf"titles/cxb/data/rss/Course/Cs000{extra_num}.csv", encoding="shift-jis" + rf"titles/cxb/data/rev/Course/Cs000{extra_num}.csv", encoding="shift-jis" ) as course: lines = course.readlines() for line in lines: @@ -233,7 +238,7 @@ class CxbRev(CxbBase): async def handle_data_mission_list_request(self, data: Dict) -> Dict: ret_str = "" with open( - r"titles/cxb/data/rss/MissionList.csv", encoding="shift-jis" + r"titles/cxb/data/rev/MissionList.csv", encoding="shift-jis" ) as mission: lines = mission.readlines() for line in lines: @@ -250,7 +255,7 @@ class CxbRev(CxbBase): async def handle_data_event_list_request(self, data: Dict) -> Dict: ret_str = "" with open( - r"titles/cxb/data/rss/Event/EventArchiveList.csv", encoding="shift-jis" + r"titles/cxb/data/rev/Event/EventArchiveList.csv", encoding="shift-jis" ) as mission: lines = mission.readlines() for line in lines: @@ -292,7 +297,7 @@ class CxbRev(CxbBase): async def handle_data_event_stamp_list_request(self, data: Dict) -> Dict: ret_str = "" with open( - r"titles/cxb/data/rss/Event/EventStampList.csv", encoding="shift-jis" + r"titles/cxb/data/rev/Event/EventStampList.csv", encoding="shift-jis" ) as event: lines = event.readlines() for line in lines: