diff --git a/meshtastic/analysis/__main__.py b/meshtastic/analysis/__main__.py index 6ad00e3..c58cad1 100644 --- a/meshtastic/analysis/__main__.py +++ b/meshtastic/analysis/__main__.py @@ -145,8 +145,8 @@ def create_dash(slog_path: str) -> Dash: """ app = Dash(external_stylesheets=[dbc.themes.BOOTSTRAP]) - dpwr = read_pandas(f"{slog_path}/power.feather") - dslog = read_pandas(f"{slog_path}/slog.feather") + dpwr = read_pandas(os.path.join(slog_path, "power.feather")) + dslog = read_pandas(os.path.join(slog_path, "slog.feather")) pmon_raises = get_pmon_raises(dslog) diff --git a/meshtastic/slog/slog.py b/meshtastic/slog/slog.py index e29c9d8..766139b 100644 --- a/meshtastic/slog/slog.py +++ b/meshtastic/slog/slog.py @@ -3,6 +3,7 @@ import atexit import io import logging +import os import re import threading import time @@ -145,7 +146,7 @@ class StructuredLogger: self.power_logger = power_logger # Setup the arrow writer (and its schema) - self.writer = FeatherWriter(f"{dir_path}/slog") + self.writer = FeatherWriter(os.path.join(dir_path, "slog")) all_fields = reduce( (lambda x, y: x + y), map(lambda x: x.fields, log_defs.values()) ) @@ -165,7 +166,7 @@ class StructuredLogger: self.raw_file: Optional[ io.TextIOWrapper ] = open( # pylint: disable=consider-using-with - f"{dir_path}/raw.txt", "w", encoding="utf8" + os.path.join(dir_path, "raw.txt"), "w", encoding="utf8" ) # We need a closure here because the subscription API is very strict about exact arg matching @@ -278,7 +279,7 @@ class LogSet: self.power_logger: Optional[PowerLogger] = ( None if not power_meter - else PowerLogger(power_meter, f"{self.dir_name}/power") + else PowerLogger(power_meter, os.path.join(self.dir_name, "power")) ) self.slog_logger: Optional[StructuredLogger] = StructuredLogger(