Closed drodarie closed 6 months ago
ConfigurationParser
needs to keep this abstract interface:
class ConfigurationParser:
def parse(): ...
def generate(): ...
I propose to instead create functional mixin classes that postprocess the return value:
class ParsesReferences:
def __init_subclass__(cls):
wrap(cls.parse, cls.parse_references)
class ParsesImports:
def __init_subclass__(cls):
wrap(cls.parse, cls.parse_imports)
So developers can:
class MyParser(ParsesRecursively, ConfigurationParser):
def parse():
return { "parsed": "value" }
and if the return value contains anything recursive it would be parsed.
Describe the work done
Add recursive configuration file parsing. This will also allow Configuration parsing though different type of parsers. Merge ConfigurationParser and ReferenceConfigurationParser.
NOTE: Configuration file reference path are currently relative to the files instead of the script, but this can be changed
List which issues this resolves:
closes #845
Tasks