Update the automagic uses to ensure a consistent ordering of the arguments.

This commit is contained in:
Mike Auty
2016-08-17 20:38:18 +01:00
parent 0fd0fa0d55
commit 6712d5dee1
3 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -34,4 +34,4 @@ def run(automagics, context, configurable, config_path = ""):
requirement.add_requirement(req)
for automagic in automagics:
automagic(context, requirement, config_path)
automagic(context, config_path, requirement)
@@ -9,7 +9,7 @@ class ConstructionMagic(interfaces.automagic.AutomagicInterface):
"""Runs through the requirement tree and from the bottom up attempts to construct all TranslationLayerRequirements"""
priority = 10
def __call__(self, context, requirement, config_path):
def __call__(self, context, config_path, requirement):
if not requirement.validate(context, config_path):
# Having called validate at the top level tells us both that we need to dig deeper
# but also ensures that TranslationLayerRequirements have got the correct subrequirements if their class is populated
+2 -2
View File
@@ -123,7 +123,7 @@ class PageMapOffsetHelper(interfaces.automagic.AutomagicInterface):
self(node, config_path)
return True
def __call__(self, context, requirement, config_path):
def __call__(self, context, config_path, requirement):
useful = []
sub_config_path = interfaces.configuration.path_join(config_path, requirement.name)
if isinstance(requirement, requirements.TranslationLayerRequirement):
@@ -156,7 +156,7 @@ class PageMapOffsetHelper(interfaces.automagic.AutomagicInterface):
break
else:
for subreq in requirement.requirements.values():
self(context, subreq, sub_config_path)
self(context, sub_config_path, subreq)
if __name__ == '__main__':