modules : explicit module file load from configuration files
This commit is contained in:
parent
3ab56a188e
commit
0890ac4507
@ -286,6 +286,7 @@
|
||||
'autoload': {'$ref': '#/definitions/dependency_selection'},
|
||||
'prerequisites': {'$ref': '#/definitions/dependency_selection'},
|
||||
'conflict': {'$ref': '#/definitions/array_of_strings'},
|
||||
'load': {'$ref': '#/definitions/array_of_strings'},
|
||||
'environment': {
|
||||
'type': 'object',
|
||||
'default': {},
|
||||
|
@ -381,6 +381,8 @@ def write(self):
|
||||
for x in filter_blacklisted(
|
||||
module_configuration.pop('autoload', []), self.name):
|
||||
module_file_content += self.autoload(x)
|
||||
for x in module_configuration.pop('load', []):
|
||||
module_file_content += self.autoload(x)
|
||||
for x in filter_blacklisted(
|
||||
module_configuration.pop('prerequisites', []), self.name):
|
||||
module_file_content += self.prerequisite(x)
|
||||
@ -402,8 +404,12 @@ def module_specific_content(self, configuration):
|
||||
return tuple()
|
||||
|
||||
def autoload(self, spec):
|
||||
m = type(self)(spec)
|
||||
return self.autoload_format.format(module_file=m.use_name)
|
||||
if not isinstance(spec, str):
|
||||
m = type(self)(spec)
|
||||
module_file = m.use_name
|
||||
else:
|
||||
module_file = spec
|
||||
return self.autoload_format.format(module_file=module_file)
|
||||
|
||||
def prerequisite(self, spec):
|
||||
m = type(self)(spec)
|
||||
|
Loading…
Reference in New Issue
Block a user