solved small bug for new name functionality to first function addtags

This commit is contained in:
alpcentaur 2024-02-06 14:35:21 +00:00
parent 4b86dfee7a
commit a2b90db08a

View file

@ -378,10 +378,10 @@ if __name__ == '__main__':
thirdarg = user_input_list[3]
except:
thirdarg = 'NONE'
if len(room_id_add_tags) >= 1 and len(new_tags) >= 1 and thirdarg == 'NONE':
if room_id_add_tags != 'NONE' and len(new_tags) >= 1 and thirdarg == 'NONE':
try:
room_file_add_tags = open('rooms/' + user_input_list[1] + '.txt', 'r')
room_file_add_tags = open('rooms/' + room_id_add_tags + '.txt', 'r')
room_info_raw = room_file_add_tags.read()
room_file_add_tags.close()
room_info = room_info_raw.split('§%§%')
@ -390,7 +390,7 @@ if __name__ == '__main__':
if tag not in tag_list:
tag_list.append(tag)
room_file_add_tags = open('rooms/' + user_input_list[1] + '.txt', 'w')
room_file_add_tags = open('rooms/' + room_id_add_tags + '.txt', 'w')
room_file_add_tags.write( str(room_info[0]) + '§%§%' + str(room_info[1]) + '§%§%' + str(tag_list))
room_file_add_tags.close()
answer = 'the updated tag list is' + str(tag_list)