Apply suggestions from code review

Co-authored-by: dgtlmoon <leigh@morresi.net>
diff-proposed-for-bwees
Brandon Wees 2 years ago committed by GitHub
parent 7011a04399
commit d24111f3a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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:

@ -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:

Loading…
Cancel
Save