From 5133806d33e4794b92b89ca6483f308bd15c6f5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krist=C3=B3f=20T=C3=B3th?= Date: Sat, 3 Mar 2018 22:44:05 +0100 Subject: [PATCH] Make Historymonitor.history a list instead of a deque (for slicing) --- lib/tfw/components/history_monitor.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/tfw/components/history_monitor.py b/lib/tfw/components/history_monitor.py index f0c2873..553d6bb 100644 --- a/lib/tfw/components/history_monitor.py +++ b/lib/tfw/components/history_monitor.py @@ -1,6 +1,5 @@ from watchdog.observers import Observer from watchdog.events import FileSystemEventHandler -from collections import deque from os.path import dirname @@ -17,7 +16,7 @@ class CallbackEventHandler(FileSystemEventHandler): class HistoryMonitor: def __init__(self, histfile): self.histfile = histfile - self._history = deque() + self._history = [] self.observer = Observer() self.observer.schedule(CallbackEventHandler(self._fetch_history), dirname(self.histfile)) @@ -27,7 +26,7 @@ class HistoryMonitor: def _fetch_history(self): with open(self.histfile, 'r') as ifile: - self._history = deque(ifile.readlines()) + self._history = ifile.readlines() def watch(self): self.observer.start()