Remove default arguments

main
Bob Mottram 2024-02-19 20:47:23 +00:00
parent aed9a6e66b
commit 66b3cdde74
4 changed files with 26 additions and 23 deletions

View File

@ -186,7 +186,8 @@ def _accept_follow(base_dir: str, message_json: {},
if follow_person(base_dir, if follow_person(base_dir,
nickname, accepted_domain_full, nickname, accepted_domain_full,
followed_nickname, followed_domain_full, followed_nickname, followed_domain_full,
federation_list, debug, group_account): federation_list, debug, group_account,
'following.txt'):
if debug: if debug:
print('DEBUG: ' + nickname + '@' + accepted_domain_full + print('DEBUG: ' + nickname + '@' + accepted_domain_full +
' followed ' + ' followed ' +

View File

@ -3723,13 +3723,13 @@ def _command_options() -> None:
domain_full = domain + ':' + str(port) domain_full = domain + ':' + str(port)
clear_follows(base_dir, nickname, domain, 'following.txt') clear_follows(base_dir, nickname, domain, 'following.txt')
follow_person(base_dir, nickname, domain, 'maxboardroom', domain_full, follow_person(base_dir, nickname, domain, 'maxboardroom', domain_full,
federation_list, False, False) federation_list, False, False, 'following.txt')
follow_person(base_dir, nickname, domain, 'ultrapancake', domain_full, follow_person(base_dir, nickname, domain, 'ultrapancake', domain_full,
federation_list, False, False) federation_list, False, False, 'following.txt')
follow_person(base_dir, nickname, domain, 'sausagedog', domain_full, follow_person(base_dir, nickname, domain, 'sausagedog', domain_full,
federation_list, False, False) federation_list, False, False, 'following.txt')
follow_person(base_dir, nickname, domain, 'drokk', domain_full, follow_person(base_dir, nickname, domain, 'drokk', domain_full,
federation_list, False, False) federation_list, False, False, 'following.txt')
add_follower_of_person(base_dir, nickname, domain, 'drokk', add_follower_of_person(base_dir, nickname, domain, 'drokk',
domain_full, federation_list, False, False) domain_full, federation_list, False, False)
add_follower_of_person(base_dir, nickname, domain, 'maxboardroom', add_follower_of_person(base_dir, nickname, domain, 'maxboardroom',

View File

@ -771,7 +771,7 @@ def create_server_alice(path: str, domain: str, port: int,
assert set_role(path, nickname, domain, 'guru') assert set_role(path, nickname, domain, 'guru')
if has_follows: if has_follows:
follow_person(path, nickname, domain, 'bob', bob_address, follow_person(path, nickname, domain, 'bob', bob_address,
federation_list, False, False) federation_list, False, False, 'following.txt')
add_follower_of_person(path, nickname, domain, 'bob', bob_address, add_follower_of_person(path, nickname, domain, 'bob', bob_address,
federation_list, False, False) federation_list, False, False)
if has_posts: if has_posts:
@ -954,7 +954,8 @@ def create_server_bob(path: str, domain: str, port: int,
delete_all_posts(path, nickname, domain, 'outbox') delete_all_posts(path, nickname, domain, 'outbox')
if has_follows and alice_address: if has_follows and alice_address:
follow_person(path, nickname, domain, follow_person(path, nickname, domain,
'alice', alice_address, federation_list, False, False) 'alice', alice_address, federation_list, False, False,
'following.txt')
add_follower_of_person(path, nickname, domain, add_follower_of_person(path, nickname, domain,
'alice', alice_address, federation_list, 'alice', alice_address, federation_list,
False, False) False, False)
@ -1508,7 +1509,8 @@ def test_post_message_between_servers(base_dir: str) -> None:
alice_domain_str, federation_list, False, False) alice_domain_str, federation_list, False, False)
bob_domain_str = bob_domain + ':' + str(bob_port) bob_domain_str = bob_domain + ':' + str(bob_port)
follow_person(alice_dir, 'alice', alice_domain, 'bob', follow_person(alice_dir, 'alice', alice_domain, 'bob',
bob_domain_str, federation_list, False, False) bob_domain_str, federation_list, False, False,
'following.txt')
session_bob = create_session(proxy_type) session_bob = create_session(proxy_type)
bob_post_log = [] bob_post_log = []
@ -2750,18 +2752,18 @@ def _test_followers_of_person(base_dir: str) -> None:
clear_follows(base_dir, nickname, domain, 'following.txt') clear_follows(base_dir, nickname, domain, 'following.txt')
follow_person(base_dir, nickname, domain, 'maxboardroom', domain, follow_person(base_dir, nickname, domain, 'maxboardroom', domain,
federation_list, False, False) federation_list, False, False, 'following.txt')
follow_person(base_dir, 'drokk', domain, 'ultrapancake', domain, follow_person(base_dir, 'drokk', domain, 'ultrapancake', domain,
federation_list, False, False) federation_list, False, False, 'following.txt')
# deliberate duplication # deliberate duplication
follow_person(base_dir, 'drokk', domain, 'ultrapancake', domain, follow_person(base_dir, 'drokk', domain, 'ultrapancake', domain,
federation_list, False, False) federation_list, False, False, 'following.txt')
follow_person(base_dir, 'sausagedog', domain, 'ultrapancake', domain, follow_person(base_dir, 'sausagedog', domain, 'ultrapancake', domain,
federation_list, False, False) federation_list, False, False, 'following.txt')
follow_person(base_dir, nickname, domain, 'ultrapancake', domain, follow_person(base_dir, nickname, domain, 'ultrapancake', domain,
federation_list, False, False) federation_list, False, False, 'following.txt')
follow_person(base_dir, nickname, domain, 'someother', 'randodomain.net', follow_person(base_dir, nickname, domain, 'someother', 'randodomain.net',
federation_list, False, False) federation_list, False, False, 'following.txt')
follow_list = get_followers_of_person(base_dir, 'ultrapancake', domain) follow_list = get_followers_of_person(base_dir, 'ultrapancake', domain)
assert len(follow_list) == 3 assert len(follow_list) == 3
@ -2799,11 +2801,11 @@ def _test_followers_on_domain(base_dir: str) -> None:
http_prefix, True, False, password) http_prefix, True, False, password)
follow_person(base_dir, 'drokk', otherdomain, nickname, domain, follow_person(base_dir, 'drokk', otherdomain, nickname, domain,
federation_list, False, False) federation_list, False, False, 'following.txt')
follow_person(base_dir, 'sausagedog', otherdomain, nickname, domain, follow_person(base_dir, 'sausagedog', otherdomain, nickname, domain,
federation_list, False, False) federation_list, False, False, 'following.txt')
follow_person(base_dir, 'maxboardroom', otherdomain, nickname, domain, follow_person(base_dir, 'maxboardroom', otherdomain, nickname, domain,
federation_list, False, False) federation_list, False, False, 'following.txt')
add_follower_of_person(base_dir, nickname, domain, add_follower_of_person(base_dir, nickname, domain,
'cucumber', 'sandwiches.party', 'cucumber', 'sandwiches.party',
@ -2905,15 +2907,15 @@ def _test_follows(base_dir: str) -> None:
clear_follows(base_dir, nickname, domain, 'following.txt') clear_follows(base_dir, nickname, domain, 'following.txt')
follow_person(base_dir, nickname, domain, 'badger', 'wild.com', follow_person(base_dir, nickname, domain, 'badger', 'wild.com',
federation_list, False, False) federation_list, False, False, 'following.txt')
follow_person(base_dir, nickname, domain, 'squirrel', 'secret.com', follow_person(base_dir, nickname, domain, 'squirrel', 'secret.com',
federation_list, False, False) federation_list, False, False, 'following.txt')
follow_person(base_dir, nickname, domain, 'rodent', 'drainpipe.com', follow_person(base_dir, nickname, domain, 'rodent', 'drainpipe.com',
federation_list, False, False) federation_list, False, False, 'following.txt')
follow_person(base_dir, nickname, domain, 'batman', 'mesh.com', follow_person(base_dir, nickname, domain, 'batman', 'mesh.com',
federation_list, False, False) federation_list, False, False, 'following.txt')
follow_person(base_dir, nickname, domain, 'giraffe', 'trees.com', follow_person(base_dir, nickname, domain, 'giraffe', 'trees.com',
federation_list, False, False) federation_list, False, False, 'following.txt')
account_dir = acct_dir(base_dir, nickname, domain) account_dir = acct_dir(base_dir, nickname, domain)
with open(account_dir + '/following.txt', 'r', with open(account_dir + '/following.txt', 'r',

View File

@ -1864,7 +1864,7 @@ def follow_person(base_dir: str, nickname: str, domain: str,
follow_nickname: str, follow_domain: str, follow_nickname: str, follow_domain: str,
federation_list: [], debug: bool, federation_list: [], debug: bool,
group_account: bool, group_account: bool,
follow_file: str = 'following.txt') -> bool: follow_file: str) -> bool:
"""Adds a person to the follow list """Adds a person to the follow list
""" """
follow_domain_str_lower1 = follow_domain.lower() follow_domain_str_lower1 = follow_domain.lower()