Minor fixes two missing includes make errors a bit more explicit in case of corrupted template

This commit is contained in:
Stanislas Daniel Claude Dolcini 2023-02-03 11:46:05 +01:00
parent 418b077ea6
commit ff1de5b36b
Signed by untrusted user: Stan
GPG Key ID: 697155C99A989EC2
3 changed files with 7 additions and 1 deletions

View File

@ -22,7 +22,11 @@ class TemplateFixer:
self.template_folder = os.path.join(vfs_root, 'simulation', 'templates')
def fix_template(self, template_path):
try:
tree = ET.parse(template_path)
except Exception as e:
print("Invalid file: " + template_path)
raise e
root = tree.getroot()
production_queue = root.find('ProductionQueue')
if production_queue == None:

View File

@ -10,6 +10,7 @@ from utils.fixers.BaseFixer import BaseFixer
from pathlib import Path
import os
import json
import shutil
import xml.etree.ElementTree as ET
class PlayerXMLFixer(BaseFixer):

View File

@ -10,6 +10,7 @@ from ..logger_utils.InterceptableLogger import InterceptableLogger
from pathlib import Path
import fileinput
import os
import xml.etree.ElementTree as ET
class BaseFixer():
def __init__(self, vfs_root, verbose=False, name=__name__):