From d8b5be9e72cb7a86d128bd2a5b395b366e9597fe Mon Sep 17 00:00:00 2001 From: Julius Unverfehrt Date: Tue, 14 Jun 2022 11:26:46 +0200 Subject: [PATCH] refactoring --- pyinfra/visitor.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/pyinfra/visitor.py b/pyinfra/visitor.py index a5050d3..25bc1e5 100644 --- a/pyinfra/visitor.py +++ b/pyinfra/visitor.py @@ -81,8 +81,8 @@ class ResponseStrategy(abc.ABC): def handle_response(self, analysis_response: dict): pass - def __call__(self, analysis_payload: dict): - return self.handle_response(analysis_payload) + def __call__(self, analysis_response: dict): + return self.handle_response(analysis_response) class StorageStrategy(ResponseStrategy): @@ -98,8 +98,8 @@ class StorageStrategy(ResponseStrategy): class ForwardingStrategy(ResponseStrategy): - def handle_response(self, body): - return body + def handle_response(self, analysis_response): + return analysis_response class DispatchCallback(abc.ABC): @@ -163,12 +163,12 @@ class AggregationStorageStrategy(ResponseStrategy): else: return Nothing - def handle_response(self, analysis_payload, final=False): + def handle_response(self, analysis_response, final=False): def upload_or_aggregate(analysis_payload): return self.upload_or_aggregate(analysis_payload, request_metadata, last=not result_data.peek(False)) - request_metadata = omit(analysis_payload, ["data"]) - result_data = peekable(analysis_payload["data"]) + request_metadata = omit(analysis_response, ["data"]) + result_data = peekable(analysis_response["data"]) yield from filter(is_not_nothing, map(upload_or_aggregate, result_data))