2022-09-24 17:56:58 -07:00
|
|
|
import util
|
|
|
|
|
|
|
|
|
|
holo_en = dict()
|
2022-09-25 04:24:04 -07:00
|
|
|
holo_id = dict()
|
|
|
|
|
niji_en = dict()
|
|
|
|
|
niji_exid = dict()
|
2022-09-24 17:56:58 -07:00
|
|
|
talents = dict()
|
|
|
|
|
|
2022-09-26 14:44:46 -07:00
|
|
|
test_talents = dict()
|
|
|
|
|
|
2022-09-24 17:56:58 -07:00
|
|
|
def __create_dict(file, _dict):
|
2022-09-25 18:31:50 -07:00
|
|
|
print(f'Initializing talents\' account list from {file}...')
|
2022-09-24 17:56:58 -07:00
|
|
|
global talents
|
|
|
|
|
with open(file, 'r') as f:
|
|
|
|
|
for line in f:
|
|
|
|
|
words = line.split()
|
|
|
|
|
if len(words) == 2 and line[0] != '#':
|
|
|
|
|
name, id = line.split()
|
|
|
|
|
talents[int(id)] = name
|
2022-09-26 02:44:26 -07:00
|
|
|
# name = util.get_username_online(id) # attempt to get updated name
|
2022-09-25 18:31:50 -07:00
|
|
|
talents[int(id)] = name
|
|
|
|
|
_dict[int(id)] = name
|
2022-09-24 17:56:58 -07:00
|
|
|
def init():
|
|
|
|
|
global holo_en
|
2022-09-25 04:24:04 -07:00
|
|
|
global holo_id
|
|
|
|
|
global niji_en
|
|
|
|
|
global niji_exid
|
2022-09-26 14:44:46 -07:00
|
|
|
global test_talents
|
2022-09-24 17:56:58 -07:00
|
|
|
|
|
|
|
|
# holoEN
|
|
|
|
|
__create_dict(f'{util.get_project_dir()}/lists/holoen.txt', holo_en)
|
2022-09-25 04:24:04 -07:00
|
|
|
# holoID
|
|
|
|
|
__create_dict(f'{util.get_project_dir()}/lists/holoid.txt', holo_id)
|
2022-09-24 17:56:58 -07:00
|
|
|
# nijiEN
|
|
|
|
|
__create_dict(f'{util.get_project_dir()}/lists/nijien.txt', niji_en)
|
2022-09-25 04:24:04 -07:00
|
|
|
# nijiexID
|
|
|
|
|
__create_dict(f'{util.get_project_dir()}/lists/nijiexid.txt', niji_exid)
|
|
|
|
|
|
2022-09-27 15:09:09 -07:00
|
|
|
test_talents = holo_en
|
2022-09-26 14:44:46 -07:00
|
|
|
|