From 6a2a1f810116ca5c672388bae9f2b3d8756e4503 Mon Sep 17 00:00:00 2001 From: Mario Zechner Date: Mon, 26 Sep 2022 13:42:03 +0200 Subject: [PATCH] [godot] Only log if actual work happens. --- spine-godot/convert.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/spine-godot/convert.py b/spine-godot/convert.py index 8e44ec32c..c6bde08f5 100755 --- a/spine-godot/convert.py +++ b/spine-godot/convert.py @@ -32,15 +32,18 @@ def convert_json(filename): print("Removing " + str(filename) + ".import") os.remove(filename + ".import") -def convert_tscn_or_tres(filename): - print("Converting TSCN file " + str(filename)) +def convert_tscn_or_tres(filename): file = codecs.open(filename, "r", "utf-8") content = file.read() file.close() new_content = "" + is_converted = False for line in content.splitlines(True): - if line.startswith("[ext_resource") and 'type="SpineSkeletonFileResource"' in line: + if line.startswith("[ext_resource") and 'type="SpineSkeletonFileResource"' in line and '.json"' in line: + if not is_converted: + print("Converting TSCN file " + str(filename)) + is_converted = True print("Replacing .json with .spine-json in \n" + line) line = line.replace('.json"', '.spine-json"') new_content += line