Rename analyze.py to count_json_values.py

This commit is contained in:
Vsevolod Kremianskii 2021-04-22 14:44:50 +07:00
parent 0e0f018b5b
commit a9840701c8
2 changed files with 6 additions and 6 deletions

View file

@ -13,7 +13,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
"""Script to process and analyze extracted resources."""
"""Script to count unique JSON values in extracted resources."""
import glob
import json
@ -44,7 +44,7 @@ def get_unique_json_values(extract_dir, path_pattern, extract_values):
return values
def analyze_unique_json_values(extract_dir, path_pattern, extract_values):
def count_unique_json_values(extract_dir, path_pattern, extract_values):
values = get_unique_json_values(extract_dir, path_pattern, extract_values)
if values:
print("{} unique values: {}".format(len(values), values))
@ -60,6 +60,6 @@ if len(sys.argv) > 2:
# in JSON files.
path_pattern = sys.argv[1]
json_key = sys.argv[2]
analyze_unique_json_values(extract_dir, path_pattern, partial(extract_values_simple, json_key))
count_unique_json_values(extract_dir, path_pattern, partial(extract_values_simple, json_key))
else:
print("Usage: python analyze.py PATH_PATTERN JSON_KEY")
print("Usage: python count_json_values.py PATH_PATTERN JSON_KEY")

View file

@ -24,9 +24,9 @@ import platform
import shutil
import subprocess
game_dir = r"D:\Games\Star Wars - KotOR2"
game_dir = r"D:\Games\Star Wars - KotOR"
tools_dir = r"D:\Source\reone\build\bin\RelWithDebInfo"
extract_dir = r"D:\OpenKotOR\Extract\TSL"
extract_dir = r"D:\OpenKotOR\Extract\KotOR"
nwnnsscomp_dir = r"D:\OpenKotOR\Tools\DeNCS"
steps = [