Fix file naming
This commit is contained in:
parent
f5845c0de6
commit
917bb5928b
20 changed files with 4 additions and 1 deletions
|
|
@ -2,6 +2,9 @@ import os
|
||||||
import json
|
import json
|
||||||
import yaml
|
import yaml
|
||||||
|
|
||||||
|
def get_file_name(profile_name):
|
||||||
|
return profile_name.replace('[', '(').replace(']', ')')
|
||||||
|
|
||||||
def find_score_for_custom_format(trash_score_set, custom_format_name, trash_id, output_dir):
|
def find_score_for_custom_format(trash_score_set, custom_format_name, trash_id, output_dir):
|
||||||
custom_formats_dir = os.path.join(output_dir, '..', 'custom_formats')
|
custom_formats_dir = os.path.join(output_dir, '..', 'custom_formats')
|
||||||
target_file = None
|
target_file = None
|
||||||
|
|
@ -97,7 +100,7 @@ def collect_profile(service, input_json, output_dir):
|
||||||
}
|
}
|
||||||
|
|
||||||
# Output path
|
# Output path
|
||||||
output_path = os.path.join(output_dir, f"{name}.yml")
|
output_path = os.path.join(output_dir, f"{get_file_name(name)}.yml")
|
||||||
with open(output_path, 'w', encoding='utf-8') as f:
|
with open(output_path, 'w', encoding='utf-8') as f:
|
||||||
yaml.dump(yml_data, f, sort_keys=False, allow_unicode=True)
|
yaml.dump(yml_data, f, sort_keys=False, allow_unicode=True)
|
||||||
print(f"Generated: {output_path}")
|
print(f"Generated: {output_path}")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue