pages 还不对
Browse files51 unmodified lines52535455565785 unmodified lines14314414514614714814951 unmodified linespage_text = page_texts[pageId]page_text = page_text.replace(' ', '')pt_boxsnew = pt.replace('.boxs', '.boxsnew')with open(pt, "r", encoding='UTF-8') as fp:box = json.load(fp)g = 085 unmodified linessign = bx["sign"]box_text = box_text + charText + signwith open(pt_boxsnew, 'w', encoding='utf-8') as fp:json.dump(box, fp, indent=4, ensure_ascii=False)51 unmodified lines5253545556575859606185 unmodified lines14714814915015115251 unmodified linespage_text = page_texts[pageId]page_text = page_text.replace(' ', '')pt_boxsnew = pt.replace('.boxs', '.boxsnew')if os.path.exists(pt_boxsnew):continuewith open(pt, "r", encoding='UTF-8') as fp:box = json.load(fp)g = 085 unmodified linessign = bx["sign"]box_text = box_text + charText + signwith open(pt_boxsnew, 'w', encoding='utf-8') as fp:json.dump(box, fp, indent=4, ensure_ascii=False)
15 unmodified lines1617181920211 unmodified line23242526272829303132333435363718 unmodified lines565758596061621 unmodified line6465666768697015 unmodified lineschs = glob.glob('data/ch*', recursive=False)for i, pth in enumerate(chs):pth = pth.replace('\\', '/')parts = pth.split('/')1 unmodified lineout2 = f'data/{chapter}/out2'boxs = glob.glob(f"{out2}/*.boxsnew", recursive=False)menus = []menu = ''menu_title = ''pages = []for j, pt in enumerate(boxs):with open(pt, "r", encoding='UTF-8') as fp:box = json.load(fp)18 unmodified linesmenus[-1]["pages"] = pagespages = []menus.append({ "menu": menu, "menu_title": menu_title })menu = ''menu_title = ''1 unmodified linepage_text = page_text + charText + signpasspages.append({ "page_text": page_text })pass15 unmodified lines161718192021221 unmodified line2425262728293031323334353637383940414243444546474849505152535418 unmodified lines737475767778791 unmodified line8182838485868715 unmodified lineschs = glob.glob('data/ch*', recursive=False)menus = []for i, pth in enumerate(chs):pth = pth.replace('\\', '/')parts = pth.split('/')1 unmodified lineout2 = f'data/{chapter}/out2'with open(f"{out2}/page_texts.json", "r", encoding='UTF-8') as fp:page_texts = json.load(fp)with open(f"{out2}/pageIds_pageNames.json", "r", encoding='UTF-8') as fp:pageIds_pageNames = json.load(fp)pageNames_pageIds = {}for k, v in pageIds_pageNames.items():pageNames_pageIds[v] = kboxs = glob.glob(f"{out2}/*.boxsnew", recursive=False)menu = ''menu_title = ''pages = []for j, pt in enumerate(boxs):pageName = Path(pt).stempageId = pageNames_pageIds[pageName]with open(pt, "r", encoding='UTF-8') as fp:box = json.load(fp)18 unmodified linesmenus[-1]["pages"] = pagespages = []menus.append({ "menu": menu, "menu_title": menu_title, "pages":pages })menu = ''menu_title = ''1 unmodified linepage_text = page_text + charText + signpasspages.append({"pageName":pageName, "pageId":pageId, "page_text": page_text })pass
exinfo.py+4-1
typ_ch.py+20-3