From 1b1933ae31548d1752cb4d390c716855eb852e18 Mon Sep 17 00:00:00 2001 From: Andrew Fenton Date: Sun, 10 Nov 2024 22:50:40 -0500 Subject: [PATCH] changed directory names --- .../src/internationalize/diffing_processor.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/i18nilize/src/internationalize/diffing_processor.py b/i18nilize/src/internationalize/diffing_processor.py index 835c17d..532c9e4 100644 --- a/i18nilize/src/internationalize/diffing_processor.py +++ b/i18nilize/src/internationalize/diffing_processor.py @@ -6,9 +6,9 @@ # Diffing Processor Class class DiffingProcessor(): def __init__(self, curr_translations_dir): - self.old_translations_root_dir = "old_translations" - self.old_translation_files_dir = os.path.join(self.old_translations_root_dir, "translations") - self.metadata_file_dir = os.path.join(self.old_translations_root_dir, "metadata.json") + self.diff_state_root_dir = "diff_state" + self.diff_state_files_dir = os.path.join(self.diff_state_root_dir, "translations") + self.metadata_file_dir = os.path.join(self.diff_state_root_dir, "metadata.json") self.curr_translation_files_dir = curr_translations_dir """ @@ -16,8 +16,8 @@ def __init__(self, curr_translations_dir): """ def setup(self): try: - os.mkdir(self.old_translations_root_dir) - os.mkdir(self.old_translation_files_dir) + os.mkdir(self.diff_state_root_dir) + os.mkdir(self.diff_state_files_dir) with open(self.metadata_file_dir, "w") as outfile: json.dump({}, outfile) @@ -25,8 +25,8 @@ def setup(self): self.sync_translations() # Compute all file hashes and store hashes in metadata - all_files = os.listdir(self.old_translation_files_dir) - all_file_hashes = compute_hashes(self.old_translation_files_dir) + all_files = os.listdir(self.diff_state_files_dir) + all_file_hashes = compute_hashes(self.diff_state_files_dir) self.update_metadata(all_files, all_file_hashes) except FileExistsError: print(f"Old translations directory has already been created.") @@ -74,7 +74,7 @@ def update_metadata(self, changed_files_list, hash_dict): json.dump(hash_dict, outfile) def sync_translations(self): - sync(self.curr_translation_files_dir, self.old_translation_files_dir, "sync", purge=True) + sync(self.curr_translation_files_dir, self.diff_state_files_dir, "sync", purge=True) """ @@ -99,4 +99,4 @@ def compute_hashes(directory): file_hash = compute_hash(file_content) hash_dict[file_name_no_ext] = file_hash - return hash_dict \ No newline at end of file + return hash_dict