Merge branch '4.1' into 4.2-beta

This commit is contained in:
Mario Zechner 2022-11-11 06:20:33 +01:00
commit 65bf27ba46

View File

@ -20,17 +20,19 @@ import os
import pathlib import pathlib
import codecs import codecs
def convert_json(filename): def convert_json(filename):
with open(filename) as file: file = codecs.open(filename, "r", "utf-8")
content = file.read() content = file.read()
if "skeleton" in content and "hash" in content and "spine" in content: file.close()
path = pathlib.Path(filename)
new_path = path.with_suffix('.spine-json') if "skeleton" in content and "hash" in content and "spine" in content:
print("Renaming " + str(path) + " to " + str(new_path)) path = pathlib.Path(filename)
path.rename(new_path) new_path = path.with_suffix('.spine-json')
if os.path.exists(filename + ".import"): print("Renaming " + str(path) + " to " + str(new_path))
print("Removing " + str(filename) + ".import") path.rename(new_path)
os.remove(filename + ".import") if os.path.exists(filename + ".import"):
print("Removing " + str(filename) + ".import")
os.remove(filename + ".import")
def convert_tscn_or_tres(filename): def convert_tscn_or_tres(filename):
file = codecs.open(filename, "r", "utf-8") file = codecs.open(filename, "r", "utf-8")