mirror of https://gitlab.com/bashrc2/epicyon
More efficient
parent
fdbe400def
commit
d68ed5bf38
|
@ -28,6 +28,11 @@ def get_moved_accounts(base_dir: str, nickname: str, domain: str,
|
||||||
print('EX: get_moved_accounts unable to read ' +
|
print('EX: get_moved_accounts unable to read ' +
|
||||||
refollow_filename)
|
refollow_filename)
|
||||||
refollow_list = refollow_str.split('\n')
|
refollow_list = refollow_str.split('\n')
|
||||||
|
refollow_dict = {}
|
||||||
|
for line in refollow_list:
|
||||||
|
prev_handle = line.split(' ')[0]
|
||||||
|
new_handle = line.split(' ')[1]
|
||||||
|
refollow_dict[prev_handle] = new_handle
|
||||||
|
|
||||||
follow_filename = \
|
follow_filename = \
|
||||||
acct_dir(base_dir, nickname, domain) + '/' + filename
|
acct_dir(base_dir, nickname, domain) + '/' + filename
|
||||||
|
@ -43,9 +48,7 @@ def get_moved_accounts(base_dir: str, nickname: str, domain: str,
|
||||||
|
|
||||||
result = {}
|
result = {}
|
||||||
for handle in follow_list:
|
for handle in follow_list:
|
||||||
for line in refollow_list:
|
if refollow_dict.get(handle):
|
||||||
if line.startswith(handle + ' '):
|
new_handle = refollow_dict[handle]
|
||||||
new_handle = line.split(' ')[1]
|
|
||||||
result[handle] = new_handle
|
result[handle] = new_handle
|
||||||
break
|
|
||||||
return result
|
return result
|
||||||
|
|
Loading…
Reference in New Issue