diff --git a/lib/tfw/components/history_monitor.py b/lib/tfw/components/history_monitor.py index 9855f57..99add98 100644 --- a/lib/tfw/components/history_monitor.py +++ b/lib/tfw/components/history_monitor.py @@ -21,7 +21,6 @@ class HistoryMonitor(ABC, InotifyObserver): See examples below. """ def __init__(self, uplink, histfile): - self._domain = '' self.histfile = histfile self.history = [] self._last_length = len(self.history) @@ -29,12 +28,9 @@ class HistoryMonitor(ABC, InotifyObserver): super().__init__(self.histfile) @property + @abstractmethod def domain(self): - return self._domain - - @domain.setter - def domain(self, domain): - self._domain = domain + raise NotImplementedError() def on_modified(self, event): self._fetch_history() @@ -78,9 +74,9 @@ class BashMonitor(HistoryMonitor): shopt -s histappend unset HISTCONTROL """ - def __init__(self, uplink, histfile): - super().__init__(uplink, histfile) - self.domain = 'bash' + @property + def domain(self): + return 'bash' @property def command_pattern(self): @@ -95,9 +91,9 @@ class GDBMonitor(HistoryMonitor): HistoryMonitor to monitor GDB sessions. For this to work "set trace-commands on" must be set in GDB. """ - def __init__(self, histfile): - super().__init__(histfile) - self.domain = 'gdb' + @property + def domain(self): + return 'gdb' @property def command_pattern(self):