From 7f7e1aca4dc658f4c6d72001dcb2b996d770fcc8 Mon Sep 17 00:00:00 2001 From: Justin Ross Date: Thu, 2 Jan 2025 07:27:47 -0500 Subject: [PATCH] WIP --- python/commands.py | 12 +++++++++--- python/common.py | 2 -- python/concepts.py | 8 ++++---- python/resources.py | 6 +++--- 4 files changed, 16 insertions(+), 12 deletions(-) diff --git a/python/commands.py b/python/commands.py index 8fd99a8..7e829d6 100644 --- a/python/commands.py +++ b/python/commands.py @@ -1,7 +1,7 @@ from resources import * def generate(model): - debug("Generating commands") + notice("Generating commands") make_dir("input/commands") @@ -51,7 +51,7 @@ def generate(model): generate_command(subcommand) def generate_command(command): - debug(f"Generating {command}") + notice(f"Generating {command}") append = StringBuilder() @@ -225,7 +225,7 @@ def generate_error(error, append): class CommandModel: def __init__(self): - debug(f"Loading {self}") + notice(f"Loading {self}") self.option_data = read_yaml("config/commands/options.yaml") @@ -300,6 +300,12 @@ def __init__(self, model, data, parent=None): command = Command(model, command_data, self) self.subcommands.append(command) + def __repr__(self): + if self.parent: + return f"{self.__class__.__name__} '{self.parent.name} {self.name}'" + else: + return super().__repr__() + def merge_option_data(self): model_options = self.model.option_data included_keys = list() diff --git a/python/common.py b/python/common.py index bdf474c..c83d80d 100644 --- a/python/common.py +++ b/python/common.py @@ -151,8 +151,6 @@ def __init__(self, model, data): self.model = model self.data = data - debug(f"Loading {self}") - def __repr__(self): return f"{self.__class__.__name__} '{self.name}'" diff --git a/python/concepts.py b/python/concepts.py index c69a639..906c40d 100644 --- a/python/concepts.py +++ b/python/concepts.py @@ -1,7 +1,7 @@ from common import * def generate(model): - debug("Generating concepts") + notice("Generating concepts") make_dir("input/concepts") @@ -37,7 +37,7 @@ def generate(model): generate_concept(concept) def generate_concept(concept): - debug(f"Generating {concept}") + notice(f"Generating {concept}") append = StringBuilder() @@ -64,7 +64,7 @@ def generate_concept_metadata(concept): class ConceptModel: def __init__(self): - debug(f"Loading {self}") + notice(f"Loading {self}") self.concepts = list() self.concepts_by_name = dict() @@ -86,7 +86,7 @@ def __init__(self): self.groups.append(ConceptGroup(self, group_data)) def __repr__(self): - return "concept model" + return self.__class__.__name__ class Concept(ModelObject): pass diff --git a/python/resources.py b/python/resources.py index 508d41c..bbb1dd6 100644 --- a/python/resources.py +++ b/python/resources.py @@ -1,7 +1,7 @@ from common import * def generate(model): - debug("Generating resources") + notice("Generating resources") make_dir("input/resources") @@ -37,7 +37,7 @@ def generate(model): generate_resource(resource) def generate_resource(resource): - debug(f"Generating {resource}") + notice(f"Generating {resource}") if resource.hidden: debug(f"{resource} is hidden") @@ -153,7 +153,7 @@ def generate_property(prop, append): class ResourceModel: def __init__(self): - debug(f"Loading {self}") + notice(f"Loading {self}") self.property_data = read_yaml("config/resources/properties.yaml")