added support for xml schemas
This commit is contained in:
@@ -5,12 +5,13 @@ import yaml
|
||||
from config import Config
|
||||
from renderer import Renderer
|
||||
from structure import Structure
|
||||
from xml_loader import XMLLoader
|
||||
|
||||
class UnsupportedFormatException(Exception):
|
||||
...
|
||||
|
||||
class InstructionSetSchema:
|
||||
VALID_EXTENSIONS = ("yaml", "json")
|
||||
VALID_EXTENSIONS = ("yaml", "json", "xml")
|
||||
|
||||
def __init__(self, path: str, configPath: str = "config.json") -> None:
|
||||
self.config = Config(configPath)
|
||||
@@ -31,6 +32,9 @@ class InstructionSetSchema:
|
||||
|
||||
elif ext == "json":
|
||||
schema = json.load(f)
|
||||
|
||||
elif ext == "xml":
|
||||
schema = XMLLoader.load(f)
|
||||
|
||||
self.structures = {}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user