Apply suggestions from code review

Co-authored-by: dgtlmoon <leigh@morresi.net>
This commit is contained in:
Brandon Wees
2022-10-27 10:52:20 -04:00
committed by GitHub
co-authored by dgtlmoon
parent 7011a04399
commit d24111f3a6
2 changed files with 3 additions and 4 deletions
+1 -2
View File
@@ -208,7 +208,7 @@ class model(dict):
if not os.path.isdir(output_path):
os.mkdir(output_path)
snapshot_fname = os.path.join(output_path, "previous.txt")
snapshot_fname = os.path.join(self.watch_data_dir, "previous.txt")
logging.debug("Saving previous text {}".format(snapshot_fname))
with open(snapshot_fname, 'wb') as f:
@@ -220,7 +220,6 @@ class model(dict):
def get_previous_text(self):
from os import path
output_path = os.path.join(self.__datastore_path, self['uuid'])
snapshot_fname = os.path.join(output_path, "previous.txt")
if self.history_n < 1:
+2 -2
View File
@@ -598,9 +598,9 @@ class ChangeDetectionStore:
# Check if the previous.txt exists
if not os.path.exists(os.path.join(self.datastore_path, uuid, "previous.txt")):
if not os.path.exists(os.path.join(watch.watch_data_dir, "previous.txt")):
# Generate a previous.txt
with open(os.path.join(self.datastore_path, uuid, "previous.txt"), "wb") as f:
with open(os.path.join(watch.watch_data_dir, "previous.txt"), "wb") as f:
# Fill it with the latest history
latest_file_name = watch.history[watch.newest_history_key]
with open(latest_file_name, "rb") as f2: