mirror of https://gitlab.com/bashrc2/epicyon
Snake case
parent
e001a54f64
commit
4e2137c443
|
@ -38,7 +38,7 @@ from follow import deny_follow_request_via_server
|
|||
from follow import get_follow_requests_via_server
|
||||
from follow import get_following_via_server
|
||||
from follow import get_followers_via_server
|
||||
from follow import send_follow_requestViaServer
|
||||
from follow import send_follow_request_via_server
|
||||
from follow import send_unfollow_request_via_server
|
||||
from posts import send_block_via_server
|
||||
from posts import send_undo_block_via_server
|
||||
|
@ -2265,18 +2265,18 @@ def run_desktop_client(base_dir: str, proxy_type: str, http_prefix: str,
|
|||
_say_command(say_str, say_str,
|
||||
screenreader, system_language, espeak)
|
||||
session_follow = create_session(proxy_type)
|
||||
send_follow_requestViaServer(base_dir,
|
||||
session_follow,
|
||||
nickname, password,
|
||||
domain, port,
|
||||
follow_nickname,
|
||||
follow_domain,
|
||||
follow_port,
|
||||
http_prefix,
|
||||
cached_webfingers,
|
||||
person_cache,
|
||||
debug, __version__,
|
||||
signing_priv_key_pem)
|
||||
send_follow_request_via_server(base_dir,
|
||||
session_follow,
|
||||
nickname, password,
|
||||
domain, port,
|
||||
follow_nickname,
|
||||
follow_domain,
|
||||
follow_port,
|
||||
http_prefix,
|
||||
cached_webfingers,
|
||||
person_cache,
|
||||
debug, __version__,
|
||||
signing_priv_key_pem)
|
||||
else:
|
||||
if follow_handle:
|
||||
say_str = follow_handle + ' is not valid'
|
||||
|
|
16
epicyon.py
16
epicyon.py
|
@ -56,7 +56,7 @@ from follow import get_following_via_server
|
|||
from follow import get_followers_via_server
|
||||
from follow import clear_follows
|
||||
from follow import add_follower_of_person
|
||||
from follow import send_follow_requestViaServer
|
||||
from follow import send_follow_request_via_server
|
||||
from follow import send_unfollow_request_via_server
|
||||
from tests import test_shared_items_federation
|
||||
from tests import test_group_follow
|
||||
|
@ -2067,13 +2067,13 @@ if args.follow:
|
|||
if args.secure_mode:
|
||||
signing_priv_key_pem = get_instance_actor_key(base_dir, domain)
|
||||
|
||||
send_follow_requestViaServer(base_dir, session,
|
||||
args.nickname, args.password,
|
||||
domain, port,
|
||||
follow_nickname, follow_domain, follow_port,
|
||||
follow_http_prefix,
|
||||
cached_webfingers, person_cache,
|
||||
debug, __version__, signing_priv_key_pem)
|
||||
send_follow_request_via_server(base_dir, session,
|
||||
args.nickname, args.password,
|
||||
domain, port,
|
||||
follow_nickname, follow_domain, follow_port,
|
||||
follow_http_prefix,
|
||||
cached_webfingers, person_cache,
|
||||
debug, __version__, signing_priv_key_pem)
|
||||
for t in range(20):
|
||||
time.sleep(1)
|
||||
# TODO some method to know if it worked
|
||||
|
|
20
follow.py
20
follow.py
|
@ -947,19 +947,19 @@ def send_follow_request(session, base_dir: str,
|
|||
return new_follow_json
|
||||
|
||||
|
||||
def send_follow_requestViaServer(base_dir: str, session,
|
||||
from_nickname: str, password: str,
|
||||
from_domain: str, from_port: int,
|
||||
follow_nickname: str, follow_domain: str,
|
||||
followPort: int,
|
||||
http_prefix: str,
|
||||
cached_webfingers: {}, person_cache: {},
|
||||
debug: bool, project_version: str,
|
||||
signing_priv_key_pem: str) -> {}:
|
||||
def send_follow_request_via_server(base_dir: str, session,
|
||||
from_nickname: str, password: str,
|
||||
from_domain: str, from_port: int,
|
||||
follow_nickname: str, follow_domain: str,
|
||||
followPort: int,
|
||||
http_prefix: str,
|
||||
cached_webfingers: {}, person_cache: {},
|
||||
debug: bool, project_version: str,
|
||||
signing_priv_key_pem: str) -> {}:
|
||||
"""Creates a follow request via c2s
|
||||
"""
|
||||
if not session:
|
||||
print('WARN: No session for send_follow_requestViaServer')
|
||||
print('WARN: No session for send_follow_request_via_server')
|
||||
return 6
|
||||
|
||||
from_domain_full = get_full_domain(from_domain, from_port)
|
||||
|
|
30
tests.py
30
tests.py
|
@ -51,7 +51,7 @@ from posts import send_post_via_server
|
|||
from posts import seconds_between_published
|
||||
from follow import clear_follows
|
||||
from follow import clear_followers
|
||||
from follow import send_follow_requestViaServer
|
||||
from follow import send_follow_request_via_server
|
||||
from follow import send_unfollow_request_via_server
|
||||
from siteactive import site_is_active
|
||||
from utils import convert_published_to_local_timezone
|
||||
|
@ -3094,13 +3094,13 @@ def test_client_to_server(base_dir: str):
|
|||
|
||||
print('\n\nAlice follows Bob')
|
||||
signing_priv_key_pem = None
|
||||
send_follow_requestViaServer(alice_dir, session_alice,
|
||||
'alice', password,
|
||||
alice_domain, alice_port,
|
||||
'bob', bob_domain, bob_port,
|
||||
http_prefix,
|
||||
cached_webfingers, person_cache,
|
||||
True, __version__, signing_priv_key_pem)
|
||||
send_follow_request_via_server(alice_dir, session_alice,
|
||||
'alice', password,
|
||||
alice_domain, alice_port,
|
||||
'bob', bob_domain, bob_port,
|
||||
http_prefix,
|
||||
cached_webfingers, person_cache,
|
||||
True, __version__, signing_priv_key_pem)
|
||||
alice_petnames_filename = alice_dir + '/accounts/' + \
|
||||
'alice@' + alice_domain + '/petnames.txt'
|
||||
alice_following_filename = \
|
||||
|
@ -3136,13 +3136,13 @@ def test_client_to_server(base_dir: str):
|
|||
alice_domain, alice_port)
|
||||
|
||||
print('\n\nEVENT: Bob follows Alice')
|
||||
send_follow_requestViaServer(alice_dir, session_alice,
|
||||
'bob', 'bobpass',
|
||||
bob_domain, bob_port,
|
||||
'alice', alice_domain, alice_port,
|
||||
http_prefix,
|
||||
cached_webfingers, person_cache,
|
||||
True, __version__, signing_priv_key_pem)
|
||||
send_follow_request_via_server(alice_dir, session_alice,
|
||||
'bob', 'bobpass',
|
||||
bob_domain, bob_port,
|
||||
'alice', alice_domain, alice_port,
|
||||
http_prefix,
|
||||
cached_webfingers, person_cache,
|
||||
True, __version__, signing_priv_key_pem)
|
||||
for _ in range(10):
|
||||
if os.path.isfile(alice_dir + '/accounts/alice@' + alice_domain +
|
||||
'/followers.txt'):
|
||||
|
|
Loading…
Reference in New Issue