Skip to content

Commit 043530a

Browse files
committed
fix linter warnings
1 parent eb45c16 commit 043530a

3 files changed

Lines changed: 11 additions & 5 deletions

File tree

meshtastic/mesh_interface.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ def showInfo(self, file=sys.stdout) -> str: # pylint: disable=W0613
214214
return infos
215215

216216
def showNodes(
217-
self, includeSelf: bool = True, file=sys.stdout
217+
self, includeSelf: bool = True
218218
) -> str: # pylint: disable=W0613
219219
"""Show table summary of nodes in mesh"""
220220

meshtastic/slog/arrow.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import logging
44
import os
5+
from typing import Optional
56

67
import pyarrow as pa
78
from pyarrow import feather
@@ -19,8 +20,8 @@ def __init__(self, file_name: str):
1920
"""
2021
self.sink = pa.OSFile(file_name, "wb") # type: ignore
2122
self.new_rows: list[dict] = []
22-
self.schema: pa.Schema | None = None # haven't yet learned the schema
23-
self.writer: pa.RecordBatchFileWriter | None = None
23+
self.schema: Optional[pa.Schema] = None # haven't yet learned the schema
24+
self.writer: Optional[pa.RecordBatchStreamWriter] = None
2425

2526
def close(self):
2627
"""Close the stream and writes the file as needed."""

meshtastic/slog/slog.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,10 @@ def __init__(self, client: MeshInterface, dir_path: str, include_raw=True) -> No
129129
if self.include_raw:
130130
all_fields.append(("raw", pa.string()))
131131

132-
self.writer.set_schema(pa.schema(all_fields))
132+
# pass in our name->type tuples a pa.fields
133+
self.writer.set_schema(
134+
pa.schema(map(lambda x: pa.field(x[0], x[1]), all_fields))
135+
)
133136

134137
self.raw_file: Optional[
135138
io.TextIOWrapper
@@ -182,7 +185,9 @@ def _onLogMessage(self, line: str) -> None:
182185
if r:
183186
di = r.named
184187
if last_is_str:
185-
di[last_field[0]] = di[last_field[0]].strip() # remove the trailing space we added
188+
di[last_field[0]] = di[
189+
last_field[0]
190+
].strip() # remove the trailing space we added
186191
if di[last_field[0]] == "":
187192
# If the last field is an empty string, remove it
188193
del di[last_field[0]]

0 commit comments

Comments
 (0)