Commit 46c8d66e authored by Robin Mueller's avatar Robin Mueller
Browse files

started implementing moving window

parent 50b841ef
......@@ -65,6 +65,9 @@ class ReturnValueParser(FileParser):
self.interfaces = interfaces
self.return_value_dict = dict()
self.count = 0
self.moving_window_size = 5
# Moving window of 5 lines will be used
self.moving_window = [""] * self.moving_window_size
# Stores last three lines
self.last_lines = ["", "", ""]
self.current_interface_id_entries = {
......@@ -90,8 +93,18 @@ class ReturnValueParser(FileParser):
print_truncated_entries = args[0]
else:
print_truncated_entries = False
for line in all_lines:
self.__handle_line_reading(line, file_name, print_truncated_entries)
for line_idx, line in enumerate(all_lines):
print(line_idx)
if line_idx < self.moving_window_size:
self.moving_window[line_idx - 1] = line
else:
self.moving_window[4] = line
for idx in range(1, 4):
self.moving_window[idx] = self.moving_window[idx - 1]
if line_idx >= 5:
pass
# for line in all_lines:
# self.__handle_line_reading(line, file_name, print_truncated_entries)
def __handle_line_reading(self, line, file_name, print_truncated_entries: bool):
newline = line
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment