Command history now also is implemented

This commit is contained in:
janis
2022-05-14 18:41:45 +02:00
parent 3fade3a2c9
commit dc2bd211e0
5 changed files with 60 additions and 1 deletions

View File

@@ -0,0 +1,24 @@
import bin.com.csv_parsers
cvr = bin.com.csv_parsers.CsvRead()
cvw = bin.com.csv_parsers.CsvWrite()
class HistroyManager:
def __init__(self):
self.__history = []
self.__history_mod = []
def append_history(self, command, path):
try:
self.__history_mod = cvr.importing(path).pop(0)
except IndexError:
pass
if command != "":
self.__history_mod.insert(0, command)
cvw.write_str(path, self.__history_mod)
else:
pass
def get_history(self, path):
return cvr.importing(path)