From 86ae33a18dc09b7a784abc521c50dd84676403c7 Mon Sep 17 00:00:00 2001 From: BodgeMaster <> Date: Sat, 11 Dec 2021 08:11:02 +0100 Subject: [PATCH] fixed a bug reulting in a variable getten overwritten instead of appended --- filetags.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/filetags.py b/filetags.py index a6a5f7c..8a1cea0 100644 --- a/filetags.py +++ b/filetags.py @@ -366,13 +366,12 @@ if __name__ == "__main__": if file_is_in_storage(storage_directory, file_tags_or_hash[0], compress): tags = get_tags_by_hash(storage_directory, file_tags_or_hash[0]) print("Tags for file:") - for tag in tags: - print(tag) + print(tags) # create a two dimensional array of all the files associated with each individual tag file_hash_lists = [] for tag in file_tags_or_hash: - file_hash_lists = get_hashes_by_tag(storage_directory, tag) + file_hash_lists = file_hash_lists + [get_hashes_by_tag(storage_directory, tag)] # take the first of the arrays in the two dimensional array common_file_hashes = file_hash_lists[0] # iterate over the two dimensional array @@ -384,8 +383,7 @@ if __name__ == "__main__": if not common_file_hashes == []: print("Files for tag(s):") - for file_hash in common_file_hashes: - print(file_hash) + print(common_file_hashes)