Last active
October 24, 2020 17:33
-
-
Save mdipierro/ddc233d653a3ffa64fd7a8072558e0fc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Injector(Fixture): | |
def __init__(self, **objects): | |
self.objects = objects | |
def transform(self, output, shared_data=None): | |
if isinstance(output, dict): | |
output.update(**self.objects) | |
return output | |
injector = Injector(menu) | |
@action('index') | |
@action.uses(injector) | |
def index(): | |
return dict() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment