1
0
forked from mirrors/0ad

Move xmlvalidator code to entity directory

The xmlvalidator logic is only used by the checkrefs.py script, so this
moves it to the same directory to have it co-located and avoid having to
modify sys.path to import it.
This commit is contained in:
Dunedan
2025-03-03 17:45:08 +01:00
parent 118ea18a58
commit 03cb24d400
5 changed files with 2 additions and 9 deletions
-3
View File
@@ -64,6 +64,3 @@ in particular, let us know and we can try to clarify it.
webservices
MIT / unspecified
xmlvalidator
MIT
+2 -6
View File
@@ -11,6 +11,8 @@ from struct import calcsize, unpack
from xml.etree import ElementTree as ET
from scriptlib import SimulTemplateEntity, find_files
from validate_grammar import RelaxNGValidator
from validator import Validator
class SingleLevelFilter(Filter):
@@ -151,16 +153,10 @@ class CheckRefs:
if args.check_unused:
self.check_unused()
if args.validate_templates:
sys.path.append(str(Path(__file__).parent.parent / "xmlvalidator"))
from validate_grammar import RelaxNGValidator
validate = RelaxNGValidator(self.vfs_root, self.mods)
if not validate.run():
self.inError = True
if args.validate_actors:
sys.path.append(str(Path(__file__).parent.parent / "xmlvalidator"))
from validator import Validator
validator = Validator(self.vfs_root, self.mods)
if not validator.run():
self.inError = True