for now dont bother renaming snapshot

pull/419/head
dgtlmoon 3 years ago
parent 305060f79c
commit ddd7b2772d

@ -366,17 +366,13 @@ class ChangeDetectionStore:
# result_obj from fetch_site_status.run() # result_obj from fetch_site_status.run()
def save_history_text(self, watch_uuid, contents): def save_history_text(self, watch_uuid, contents):
import uuid import uuid
import content_fetcher
output_path = "{}/{}".format(self.datastore_path, watch_uuid) output_path = "{}/{}".format(self.datastore_path, watch_uuid)
# Incase the operator deleted it, check and create. # Incase the operator deleted it, check and create.
if not os.path.isdir(output_path): if not os.path.isdir(output_path):
mkdir(output_path) mkdir(output_path)
if (content_fetcher.supported_binary_type(self.data['watching'][watch_uuid]['content-type'])): suffix = "stripped.txt"
suffix = ".bin"
else:
suffix = "stripped.txt"
fname = "{}/{}.{}".format(output_path, uuid.uuid4(), suffix) fname = "{}/{}.{}".format(output_path, uuid.uuid4(), suffix)
with open(fname, 'wb') as f: with open(fname, 'wb') as f:

Loading…
Cancel
Save