|
@@ -4,9 +4,11 @@ class LogList():
|
|
def __init__(self):
|
|
def __init__(self):
|
|
self.log_list = list()
|
|
self.log_list = list()
|
|
self.read_index = 0
|
|
self.read_index = 0
|
|
|
|
+ self.write_index = 0
|
|
|
|
|
|
def add_item(self, item):
|
|
def add_item(self, item):
|
|
self.log_list.append(item)
|
|
self.log_list.append(item)
|
|
|
|
+ self.write_index += 1
|
|
if len(self.log_list) > 100:
|
|
if len(self.log_list) > 100:
|
|
self.log_list.pop(0)
|
|
self.log_list.pop(0)
|
|
|
|
|
|
@@ -22,7 +24,7 @@ class LogList():
|
|
|
|
|
|
def get_new_items(self):
|
|
def get_new_items(self):
|
|
items = self.log_list[self.read_index:]
|
|
items = self.log_list[self.read_index:]
|
|
- self.read_index = len(self.log_list)
|
|
|
|
|
|
+ self.read_index = self.write_index
|
|
return items
|
|
return items
|
|
|
|
|
|
|
|
|