Skip to content
Snippets Groups Projects
Commit 28c92a19 authored by Kien Le's avatar Kien Le
Browse files

Create stub for log file reader

parent 133470ed
No related branches found
No related tags found
1 merge request!191Read log files generated by users
from pathlib import Path
from typing import List
def detect_log_file_packet_format(packet: List[str]):
pass
def read_soh_packet_base(packet: List[str]):
pass
def read_soh_packet_rt2ms(packet: List[str]):
pass
def read_soh_packet_rt2ms(packet: List[str]):
pass
class LogFile:
def __init__(self, file_path: Path):
self.file_path = file_path
self.file = open(file_path)
def __iter__(self):
return self
def __next__(self):
return self.file.readline()
def __del__(self):
self.file.close()
class LogFileReader:
"""
Class that reads a log file.
"""
def __init__(self, file_path: Path):
self.file_path = file_path
self.packet_reader = None
self.log_file_type: LogFileFormat
def read(self):
log_file = LogFile(self.file_path)
for packet in log_file:
pass
if __name__ == '__main__':
pass
a = LogFileReader(Path('/Users/kle/PycharmProjects/sohstationviewer/9BB3.log'))
a.read()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment