Skip to content

Commit

Permalink
EVALG-77: Apply linter with correct parameters (-l 79)
Browse files Browse the repository at this point in the history
  • Loading branch information
Alxe committed Sep 30, 2024
1 parent ab4860a commit a39fd81
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
8 changes: 6 additions & 2 deletions tutorials/application_design/py/publisher.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ def __init__(
vehicle_position = vehicle_route.pop(0)

self._metrics = VehicleMetrics(vehicle_vin, 100.0)
self._transit = VehicleTransit(vehicle_vin, vehicle_position, vehicle_route)
self._transit = VehicleTransit(
vehicle_vin, vehicle_position, vehicle_route
)

def __repr__(self):
return (
Expand Down Expand Up @@ -96,7 +98,9 @@ def run(self):
if self._is_out_of_fuel:
self._metrics.fuel_level = 0.0

print(f"Vehicle '{self._metrics.vehicle_vin}' ran out of fuel!")
print(
f"Vehicle '{self._metrics.vehicle_vin}' ran out of fuel!"
)


def main():
Expand Down
12 changes: 7 additions & 5 deletions tutorials/application_design/py/subscriber.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,17 +86,17 @@ def display_handler():

def _create_new_position_string(self, condition):
string = ""
for sample, info in self._transit_reader.select().condition(condition).read():
for sample, info in (
self._transit_reader.select().condition(condition).read()
):
if not info.valid:
continue

string += f"[INFO] Vehicle {sample.vehicle_vin}"
if sample.current_route and len(sample.current_route):
string += f" is en route to {sample.current_route[-1]} from {sample.current_position}"
else:
string += (
f" has arrived at its destination in {sample.current_position}"
)
string += f" has arrived at its destination in {sample.current_position}"
string += "\n"
return string

Expand All @@ -116,7 +116,9 @@ def _create_dashboard_string(self):
f" Last known fuel level: {data.fuel_history[-1]}\n"
for data in online_vehicles
)
offline_str = "\n".join(f"Vehicle {data.vin}" for data in offline_vehicles)
offline_str = "\n".join(
f"Vehicle {data.vin}" for data in offline_vehicles
)

return "\n".join(
[
Expand Down

0 comments on commit a39fd81

Please sign in to comment.