|
@ -368,6 +368,7 @@ if __name__ == '__main__': |
|
|
try: |
|
|
try: |
|
|
room_name_add_tags = user_input_list[1] |
|
|
room_name_add_tags = user_input_list[1] |
|
|
room_id_add_tags = name2id(room_name_add_tags) |
|
|
room_id_add_tags = name2id(room_name_add_tags) |
|
|
|
|
|
print(room_id_add_tags) |
|
|
except: |
|
|
except: |
|
|
room_id_add_tags = 'NONE' |
|
|
room_id_add_tags = 'NONE' |
|
|
try: |
|
|
try: |
|
@ -380,18 +381,16 @@ if __name__ == '__main__': |
|
|
thirdarg = 'NONE' |
|
|
thirdarg = 'NONE' |
|
|
if room_id_add_tags != 'NONE' and len(new_tags) >= 1 and thirdarg == 'NONE': |
|
|
if room_id_add_tags != 'NONE' and len(new_tags) >= 1 and thirdarg == 'NONE': |
|
|
try: |
|
|
try: |
|
|
|
|
|
|
|
|
room_file_add_tags = open('rooms/' + room_id_add_tags + '.txt', 'r') |
|
|
room_file_add_tags = open('rooms/' + room_id_add_tags + '.txt', 'r') |
|
|
room_info_raw = room_file_add_tags.read() |
|
|
room_info_raw = room_file_add_tags.read() |
|
|
room_file_add_tags.close() |
|
|
room_file_add_tags.close() |
|
|
room_info = room_info_raw.split('§%§%') |
|
|
room_info = room_info_raw.split('§%§%') |
|
|
tag_list = eval(room_info[-1]) |
|
|
|
|
|
|
|
|
tag_list = eval(room_info[-2]) |
|
|
for tag in eval(user_input_list[2]): |
|
|
for tag in eval(user_input_list[2]): |
|
|
if tag not in tag_list: |
|
|
if tag not in tag_list: |
|
|
tag_list.append(tag) |
|
|
tag_list.append(tag) |
|
|
|
|
|
|
|
|
room_file_add_tags = open('rooms/' + room_id_add_tags + '.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.write( str(room_info[0]) + '§%§%' + str(room_info[1]) + '§%§%' + str(tag_list) + '§%§%' + str(room_info[-1])) |
|
|
room_file_add_tags.close() |
|
|
room_file_add_tags.close() |
|
|
answer = 'the updated tag list is' + str(tag_list) |
|
|
answer = 'the updated tag list is' + str(tag_list) |
|
|
|
|
|
|
|
|