You've already forked PythonLib
mirror of
https://github.com/lifebottle/PythonLib.git
synced 2026-02-13 15:25:50 -08:00
Adding TODDC_Test file + Comments to debug
This commit is contained in:
18
TODDC_Test.py
Normal file
18
TODDC_Test.py
Normal file
@@ -0,0 +1,18 @@
|
||||
import ToolsTODDC
|
||||
import json
|
||||
import struct
|
||||
import comptolib
|
||||
import io
|
||||
import re
|
||||
import string
|
||||
import pandas as pd
|
||||
import json
|
||||
import os
|
||||
import lxml.etree as etree
|
||||
|
||||
|
||||
tool = ToolsTODDC.ToolsTODDC("toddc.tbl")
|
||||
|
||||
ele = tool.menu_files_json[0]
|
||||
tool.extract_Menu_File(ele)
|
||||
|
||||
@@ -42,7 +42,7 @@ class ToolsTODDC(ToolsTales):
|
||||
#self.icolors = dict([[i, j] for j, i in self.jsonTblTags['COLORS'].items()])
|
||||
|
||||
|
||||
with open("../{}/Data/{}/Menu/MenuFiles.json".format(self.repo_name, self.gameName)) as f:
|
||||
with open("../{}/Data/Menu/MenuFiles.json".format(self.repo_name, self.gameName)) as f:
|
||||
self.menu_files_json = json.load(f)
|
||||
|
||||
|
||||
@@ -891,12 +891,14 @@ class ToolsTales:
|
||||
text_end = section['Text_End']
|
||||
|
||||
#Extract Pointers of the file
|
||||
print("Extract Pointers")
|
||||
pointers_offset, pointers_value = self.get_special_pointers( text_start, text_end, base_offset, section['Pointer_Offset_Start'], section['Nb_Per_Block'], section['Step'], section['Section'], file_path)
|
||||
|
||||
|
||||
#Extract Text from the pointers
|
||||
print("Extract Text")
|
||||
texts = [ self.bytes_to_text(f, ele + base_offset)[0] for ele in pointers_value]
|
||||
|
||||
print(texts)
|
||||
|
||||
#Make a list
|
||||
section_list.extend( [section['Section']] * len(texts))
|
||||
|
||||
BIN
__pycache__/ToolsTODDC.cpython-38.pyc
Normal file
BIN
__pycache__/ToolsTODDC.cpython-38.pyc
Normal file
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user