Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
ssorj committed Jan 2, 2025
1 parent 4818024 commit 7f7e1ac
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 12 deletions.
12 changes: 9 additions & 3 deletions python/commands.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from resources import *

def generate(model):
debug("Generating commands")
notice("Generating commands")

make_dir("input/commands")

Expand Down Expand Up @@ -51,7 +51,7 @@ def generate(model):
generate_command(subcommand)

def generate_command(command):
debug(f"Generating {command}")
notice(f"Generating {command}")

append = StringBuilder()

Expand Down Expand Up @@ -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")

Expand Down Expand Up @@ -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()
Expand Down
2 changes: 0 additions & 2 deletions python/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}'"

Expand Down
8 changes: 4 additions & 4 deletions python/concepts.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from common import *

def generate(model):
debug("Generating concepts")
notice("Generating concepts")

make_dir("input/concepts")

Expand Down Expand Up @@ -37,7 +37,7 @@ def generate(model):
generate_concept(concept)

def generate_concept(concept):
debug(f"Generating {concept}")
notice(f"Generating {concept}")

append = StringBuilder()

Expand All @@ -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()
Expand All @@ -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
Expand Down
6 changes: 3 additions & 3 deletions python/resources.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from common import *

def generate(model):
debug("Generating resources")
notice("Generating resources")

make_dir("input/resources")

Expand Down Expand Up @@ -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")
Expand Down Expand Up @@ -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")

Expand Down

0 comments on commit 7f7e1ac

Please sign in to comment.