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:
@@ -64,6 +64,3 @@ in particular, let us know and we can try to clarify it.
|
||||
|
||||
webservices
|
||||
MIT / unspecified
|
||||
|
||||
xmlvalidator
|
||||
MIT
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user