Skip to content

Commit 44844f3

Browse files
authored
Update to black 2024 (#10)
1 parent 16e3edf commit 44844f3

File tree

2 files changed

+20
-20
lines changed

2 files changed

+20
-20
lines changed

openpaygo/metrics_request.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,10 @@ def get_simple_request_dict(self):
5050
simple_request["historical_data"] = self.historical_data
5151
# We prepare the auth
5252
if self.auth_method:
53-
simple_request[
54-
"auth"
55-
] = OpenPAYGOMetricsShared.generate_request_signature_from_data(
56-
simple_request, self.auth_method, self.secret_key
53+
simple_request["auth"] = (
54+
OpenPAYGOMetricsShared.generate_request_signature_from_data(
55+
simple_request, self.auth_method, self.secret_key
56+
)
5757
)
5858
return simple_request
5959

@@ -83,10 +83,10 @@ def get_condensed_request_dict(self):
8383
raise ValueError(
8484
"Additional variables not present in the data format: " + str(data_copy)
8585
)
86-
condensed_request[
87-
"data"
88-
] = OpenPAYGOMetricsShared.remove_trailing_empty_elements(
89-
condensed_request["data"]
86+
condensed_request["data"] = (
87+
OpenPAYGOMetricsShared.remove_trailing_empty_elements(
88+
condensed_request["data"]
89+
)
9090
)
9191
# We add the historical data
9292
historical_data_copy = copy.deepcopy(self.historical_data)
@@ -105,10 +105,10 @@ def get_condensed_request_dict(self):
105105
condensed_request["historical_data"].append(time_step_data)
106106
# We prepare the auth
107107
if self.auth_method:
108-
condensed_request[
109-
"auth"
110-
] = OpenPAYGOMetricsShared.generate_request_signature_from_data(
111-
condensed_request, self.auth_method, self.secret_key
108+
condensed_request["auth"] = (
109+
OpenPAYGOMetricsShared.generate_request_signature_from_data(
110+
condensed_request, self.auth_method, self.secret_key
111+
)
112112
)
113113
# We replace the key names by the condensed ones
114114
condensed_request = OpenPAYGOMetricsShared.convert_dict_keys_to_condensed(

openpaygo/metrics_response.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -171,14 +171,14 @@ def get_answer_dict(self):
171171
# If there is not data format, we just return the full response
172172
condensed_answer = copy.deepcopy(self.response_dict)
173173
if self.secret_key:
174-
condensed_answer[
175-
"auth"
176-
] = OpenPAYGOMetricsShared.generate_response_signature_from_data(
177-
serial_number=self.request_dict.get("serial_number"),
178-
request_count=self.request_dict.get("request_count"),
179-
data=condensed_answer,
180-
timestamp=self.request_dict.get("timestamp"),
181-
secret_key=self.secret_key,
174+
condensed_answer["auth"] = (
175+
OpenPAYGOMetricsShared.generate_response_signature_from_data(
176+
serial_number=self.request_dict.get("serial_number"),
177+
request_count=self.request_dict.get("request_count"),
178+
data=condensed_answer,
179+
timestamp=self.request_dict.get("timestamp"),
180+
secret_key=self.secret_key,
181+
)
182182
)
183183
return OpenPAYGOMetricsShared.convert_dict_keys_to_condensed(condensed_answer)
184184

0 commit comments

Comments
 (0)