mirror of https://gitlab.com/bashrc2/epicyon
Snake case
parent
0d4088705f
commit
6326203952
14
epicyon.py
14
epicyon.py
|
@ -2200,21 +2200,21 @@ if args.followers:
|
|||
signing_priv_key_pem = None
|
||||
if args.secure_mode:
|
||||
signing_priv_key_pem = get_instance_actor_key(base_dir, domain)
|
||||
wfRequest = webfinger_handle(session, handle,
|
||||
wf_request = webfinger_handle(session, handle,
|
||||
http_prefix, cached_webfingers,
|
||||
hostDomain, __version__, debug, False,
|
||||
signing_priv_key_pem)
|
||||
if not wfRequest:
|
||||
if not wf_request:
|
||||
print('Unable to webfinger ' + handle)
|
||||
sys.exit()
|
||||
if not isinstance(wfRequest, dict):
|
||||
if not isinstance(wf_request, dict):
|
||||
print('Webfinger for ' + handle + ' did not return a dict. ' +
|
||||
str(wfRequest))
|
||||
str(wf_request))
|
||||
sys.exit()
|
||||
|
||||
personUrl = None
|
||||
if wfRequest.get('errors'):
|
||||
print('wfRequest error: ' + str(wfRequest['errors']))
|
||||
if wf_request.get('errors'):
|
||||
print('wf_request error: ' + str(wf_request['errors']))
|
||||
if has_users_path(args.followers):
|
||||
personUrl = originalActor
|
||||
else:
|
||||
|
@ -2225,7 +2225,7 @@ if args.followers:
|
|||
'Accept': 'application/activity+json; profile="' + profileStr + '"'
|
||||
}
|
||||
if not personUrl:
|
||||
personUrl = get_user_url(wfRequest, 0, args.debug)
|
||||
personUrl = get_user_url(wf_request, 0, args.debug)
|
||||
if nickname == domain:
|
||||
personUrl = personUrl.replace('/users/', '/actor/')
|
||||
personUrl = personUrl.replace('/accounts/', '/actor/')
|
||||
|
|
24
like.py
24
like.py
|
@ -198,27 +198,27 @@ def send_like_via_server(base_dir: str, session,
|
|||
handle = http_prefix + '://' + fromDomainFull + '/@' + fromNickname
|
||||
|
||||
# lookup the inbox for the To handle
|
||||
wfRequest = webfinger_handle(session, handle, http_prefix,
|
||||
wf_request = webfinger_handle(session, handle, http_prefix,
|
||||
cached_webfingers,
|
||||
fromDomain, project_version, debug, False,
|
||||
signing_priv_key_pem)
|
||||
if not wfRequest:
|
||||
if not wf_request:
|
||||
if debug:
|
||||
print('DEBUG: like webfinger failed for ' + handle)
|
||||
return 1
|
||||
if not isinstance(wfRequest, dict):
|
||||
if not isinstance(wf_request, dict):
|
||||
print('WARN: like webfinger for ' + handle +
|
||||
' did not return a dict. ' + str(wfRequest))
|
||||
' did not return a dict. ' + str(wf_request))
|
||||
return 1
|
||||
|
||||
postToBox = 'outbox'
|
||||
|
||||
# get the actor inbox for the To handle
|
||||
originDomain = fromDomain
|
||||
(inboxUrl, pubKeyId, pubKey, fromPersonId, sharedInbox, avatarUrl,
|
||||
displayName, _) = get_person_box(signing_priv_key_pem,
|
||||
(inboxUrl, _, _, fromPersonId, _, _,
|
||||
_, _) = get_person_box(signing_priv_key_pem,
|
||||
originDomain,
|
||||
base_dir, session, wfRequest,
|
||||
base_dir, session, wf_request,
|
||||
person_cache,
|
||||
project_version, http_prefix,
|
||||
fromNickname, fromDomain,
|
||||
|
@ -285,18 +285,18 @@ def send_undo_like_via_server(base_dir: str, session,
|
|||
handle = http_prefix + '://' + fromDomainFull + '/@' + fromNickname
|
||||
|
||||
# lookup the inbox for the To handle
|
||||
wfRequest = webfinger_handle(session, handle, http_prefix,
|
||||
wf_request = webfinger_handle(session, handle, http_prefix,
|
||||
cached_webfingers,
|
||||
fromDomain, project_version, debug, False,
|
||||
signing_priv_key_pem)
|
||||
if not wfRequest:
|
||||
if not wf_request:
|
||||
if debug:
|
||||
print('DEBUG: unlike webfinger failed for ' + handle)
|
||||
return 1
|
||||
if not isinstance(wfRequest, dict):
|
||||
if not isinstance(wf_request, dict):
|
||||
if debug:
|
||||
print('WARN: unlike webfinger for ' + handle +
|
||||
' did not return a dict. ' + str(wfRequest))
|
||||
' did not return a dict. ' + str(wf_request))
|
||||
return 1
|
||||
|
||||
postToBox = 'outbox'
|
||||
|
@ -306,7 +306,7 @@ def send_undo_like_via_server(base_dir: str, session,
|
|||
(inboxUrl, pubKeyId, pubKey, fromPersonId, sharedInbox, avatarUrl,
|
||||
displayName, _) = get_person_box(signing_priv_key_pem,
|
||||
originDomain,
|
||||
base_dir, session, wfRequest,
|
||||
base_dir, session, wf_request,
|
||||
person_cache, project_version,
|
||||
http_prefix, fromNickname,
|
||||
fromDomain, postToBox,
|
||||
|
|
14
migrate.py
14
migrate.py
|
@ -60,26 +60,26 @@ def _update_moved_handle(base_dir: str, nickname: str, domain: str,
|
|||
return ctr
|
||||
if handle.startswith('@'):
|
||||
handle = handle[1:]
|
||||
wfRequest = webfinger_handle(session, handle,
|
||||
wf_request = webfinger_handle(session, handle,
|
||||
http_prefix, cached_webfingers,
|
||||
domain, __version__, debug, False,
|
||||
signing_priv_key_pem)
|
||||
if not wfRequest:
|
||||
if not wf_request:
|
||||
print('updateMovedHandle unable to webfinger ' + handle)
|
||||
return ctr
|
||||
|
||||
if not isinstance(wfRequest, dict):
|
||||
if not isinstance(wf_request, dict):
|
||||
print('updateMovedHandle webfinger for ' + handle +
|
||||
' did not return a dict. ' + str(wfRequest))
|
||||
' did not return a dict. ' + str(wf_request))
|
||||
return ctr
|
||||
|
||||
personUrl = None
|
||||
if wfRequest.get('errors'):
|
||||
print('wfRequest error: ' + str(wfRequest['errors']))
|
||||
if wf_request.get('errors'):
|
||||
print('wf_request error: ' + str(wf_request['errors']))
|
||||
return ctr
|
||||
|
||||
if not personUrl:
|
||||
personUrl = get_user_url(wfRequest, 0, debug)
|
||||
personUrl = get_user_url(wf_request, 0, debug)
|
||||
if not personUrl:
|
||||
return ctr
|
||||
|
||||
|
|
22
person.py
22
person.py
|
@ -1523,7 +1523,7 @@ def get_actor_json(hostDomain: str, handle: str, http: bool, gnunet: bool,
|
|||
nickname = domain
|
||||
|
||||
personUrl = None
|
||||
wfRequest = None
|
||||
wf_request = None
|
||||
|
||||
if '://' in originalActor and \
|
||||
originalActor.lower().endswith('/actor'):
|
||||
|
@ -1536,27 +1536,27 @@ def get_actor_json(hostDomain: str, handle: str, http: bool, gnunet: bool,
|
|||
personUrl = originalActor
|
||||
else:
|
||||
handle = nickname + '@' + domain
|
||||
wfRequest = webfinger_handle(session, handle,
|
||||
wf_request = webfinger_handle(session, handle,
|
||||
http_prefix, cached_webfingers,
|
||||
hostDomain, __version__, debug,
|
||||
group_account, signing_priv_key_pem)
|
||||
if not wfRequest:
|
||||
if not wf_request:
|
||||
if not quiet:
|
||||
print('get_actor_json Unable to webfinger ' + handle)
|
||||
return None, None
|
||||
if not isinstance(wfRequest, dict):
|
||||
if not isinstance(wf_request, dict):
|
||||
if not quiet:
|
||||
print('get_actor_json Webfinger for ' + handle +
|
||||
' did not return a dict. ' + str(wfRequest))
|
||||
' did not return a dict. ' + str(wf_request))
|
||||
return None, None
|
||||
|
||||
if not quiet:
|
||||
pprint(wfRequest)
|
||||
pprint(wf_request)
|
||||
|
||||
if wfRequest.get('errors'):
|
||||
if wf_request.get('errors'):
|
||||
if not quiet or debug:
|
||||
print('get_actor_json wfRequest error: ' +
|
||||
str(wfRequest['errors']))
|
||||
print('get_actor_json wf_request error: ' +
|
||||
str(wf_request['errors']))
|
||||
if has_users_path(handle):
|
||||
personUrl = originalActor
|
||||
else:
|
||||
|
@ -1568,8 +1568,8 @@ def get_actor_json(hostDomain: str, handle: str, http: bool, gnunet: bool,
|
|||
headersList = (
|
||||
"activity+json", "ld+json", "jrd+json"
|
||||
)
|
||||
if not personUrl and wfRequest:
|
||||
personUrl = get_user_url(wfRequest, 0, debug)
|
||||
if not personUrl and wf_request:
|
||||
personUrl = get_user_url(wf_request, 0, debug)
|
||||
if nickname == domain:
|
||||
paths = get_user_paths()
|
||||
for userPath in paths:
|
||||
|
|
10
pgp.py
10
pgp.py
|
@ -556,19 +556,19 @@ def pgp_public_key_upload(base_dir: str, session,
|
|||
print('actor update is ' + str(actorUpdate))
|
||||
|
||||
# lookup the inbox for the To handle
|
||||
wfRequest = \
|
||||
wf_request = \
|
||||
webfinger_handle(session, handle, http_prefix, cached_webfingers,
|
||||
domain, __version__, debug, False,
|
||||
signing_priv_key_pem)
|
||||
if not wfRequest:
|
||||
if not wf_request:
|
||||
if debug:
|
||||
print('DEBUG: pgp actor update webfinger failed for ' +
|
||||
handle)
|
||||
return None
|
||||
if not isinstance(wfRequest, dict):
|
||||
if not isinstance(wf_request, dict):
|
||||
if debug:
|
||||
print('WARN: Webfinger for ' + handle +
|
||||
' did not return a dict. ' + str(wfRequest))
|
||||
' did not return a dict. ' + str(wf_request))
|
||||
return None
|
||||
|
||||
postToBox = 'outbox'
|
||||
|
@ -577,7 +577,7 @@ def pgp_public_key_upload(base_dir: str, session,
|
|||
originDomain = domain
|
||||
(inboxUrl, pubKeyId, pubKey, fromPersonId, sharedInbox, avatarUrl,
|
||||
displayName, _) = get_person_box(signing_priv_key_pem, originDomain,
|
||||
base_dir, session, wfRequest,
|
||||
base_dir, session, wf_request,
|
||||
person_cache,
|
||||
__version__, http_prefix, nickname,
|
||||
domain, postToBox, 35725)
|
||||
|
|
40
shares.py
40
shares.py
|
@ -609,18 +609,18 @@ def send_share_via_server(base_dir, session,
|
|||
handle = http_prefix + '://' + fromDomainFull + '/@' + fromNickname
|
||||
|
||||
# lookup the inbox for the To handle
|
||||
wfRequest = \
|
||||
wf_request = \
|
||||
webfinger_handle(session, handle, http_prefix,
|
||||
cached_webfingers,
|
||||
fromDomain, project_version, debug, False,
|
||||
signing_priv_key_pem)
|
||||
if not wfRequest:
|
||||
if not wf_request:
|
||||
if debug:
|
||||
print('DEBUG: share webfinger failed for ' + handle)
|
||||
return 1
|
||||
if not isinstance(wfRequest, dict):
|
||||
if not isinstance(wf_request, dict):
|
||||
print('WARN: share webfinger for ' + handle +
|
||||
' did not return a dict. ' + str(wfRequest))
|
||||
' did not return a dict. ' + str(wf_request))
|
||||
return 1
|
||||
|
||||
postToBox = 'outbox'
|
||||
|
@ -630,7 +630,7 @@ def send_share_via_server(base_dir, session,
|
|||
(inboxUrl, pubKeyId, pubKey, fromPersonId, sharedInbox, avatarUrl,
|
||||
displayName, _) = get_person_box(signing_priv_key_pem,
|
||||
originDomain,
|
||||
base_dir, session, wfRequest,
|
||||
base_dir, session, wf_request,
|
||||
person_cache, project_version,
|
||||
http_prefix, fromNickname,
|
||||
fromDomain, postToBox,
|
||||
|
@ -714,17 +714,17 @@ def send_undo_share_via_server(base_dir: str, session,
|
|||
handle = http_prefix + '://' + fromDomainFull + '/@' + fromNickname
|
||||
|
||||
# lookup the inbox for the To handle
|
||||
wfRequest = \
|
||||
wf_request = \
|
||||
webfinger_handle(session, handle, http_prefix, cached_webfingers,
|
||||
fromDomain, project_version, debug, False,
|
||||
signing_priv_key_pem)
|
||||
if not wfRequest:
|
||||
if not wf_request:
|
||||
if debug:
|
||||
print('DEBUG: unshare webfinger failed for ' + handle)
|
||||
return 1
|
||||
if not isinstance(wfRequest, dict):
|
||||
if not isinstance(wf_request, dict):
|
||||
print('WARN: unshare webfinger for ' + handle +
|
||||
' did not return a dict. ' + str(wfRequest))
|
||||
' did not return a dict. ' + str(wf_request))
|
||||
return 1
|
||||
|
||||
postToBox = 'outbox'
|
||||
|
@ -734,7 +734,7 @@ def send_undo_share_via_server(base_dir: str, session,
|
|||
(inboxUrl, pubKeyId, pubKey, fromPersonId, sharedInbox, avatarUrl,
|
||||
displayName, _) = get_person_box(signing_priv_key_pem,
|
||||
originDomain,
|
||||
base_dir, session, wfRequest,
|
||||
base_dir, session, wf_request,
|
||||
person_cache, project_version,
|
||||
http_prefix, fromNickname,
|
||||
fromDomain, postToBox,
|
||||
|
@ -829,18 +829,18 @@ def send_wanted_via_server(base_dir, session,
|
|||
handle = http_prefix + '://' + fromDomainFull + '/@' + fromNickname
|
||||
|
||||
# lookup the inbox for the To handle
|
||||
wfRequest = \
|
||||
wf_request = \
|
||||
webfinger_handle(session, handle, http_prefix,
|
||||
cached_webfingers,
|
||||
fromDomain, project_version, debug, False,
|
||||
signing_priv_key_pem)
|
||||
if not wfRequest:
|
||||
if not wf_request:
|
||||
if debug:
|
||||
print('DEBUG: share webfinger failed for ' + handle)
|
||||
return 1
|
||||
if not isinstance(wfRequest, dict):
|
||||
if not isinstance(wf_request, dict):
|
||||
print('WARN: wanted webfinger for ' + handle +
|
||||
' did not return a dict. ' + str(wfRequest))
|
||||
' did not return a dict. ' + str(wf_request))
|
||||
return 1
|
||||
|
||||
postToBox = 'outbox'
|
||||
|
@ -850,7 +850,7 @@ def send_wanted_via_server(base_dir, session,
|
|||
(inboxUrl, pubKeyId, pubKey, fromPersonId, sharedInbox, avatarUrl,
|
||||
displayName, _) = get_person_box(signing_priv_key_pem,
|
||||
originDomain,
|
||||
base_dir, session, wfRequest,
|
||||
base_dir, session, wf_request,
|
||||
person_cache, project_version,
|
||||
http_prefix, fromNickname,
|
||||
fromDomain, postToBox,
|
||||
|
@ -934,17 +934,17 @@ def send_undo_wanted_via_server(base_dir: str, session,
|
|||
handle = http_prefix + '://' + fromDomainFull + '/@' + fromNickname
|
||||
|
||||
# lookup the inbox for the To handle
|
||||
wfRequest = \
|
||||
wf_request = \
|
||||
webfinger_handle(session, handle, http_prefix, cached_webfingers,
|
||||
fromDomain, project_version, debug, False,
|
||||
signing_priv_key_pem)
|
||||
if not wfRequest:
|
||||
if not wf_request:
|
||||
if debug:
|
||||
print('DEBUG: unwant webfinger failed for ' + handle)
|
||||
return 1
|
||||
if not isinstance(wfRequest, dict):
|
||||
if not isinstance(wf_request, dict):
|
||||
print('WARN: unwant webfinger for ' + handle +
|
||||
' did not return a dict. ' + str(wfRequest))
|
||||
' did not return a dict. ' + str(wf_request))
|
||||
return 1
|
||||
|
||||
postToBox = 'outbox'
|
||||
|
@ -954,7 +954,7 @@ def send_undo_wanted_via_server(base_dir: str, session,
|
|||
(inboxUrl, pubKeyId, pubKey, fromPersonId, sharedInbox, avatarUrl,
|
||||
displayName, _) = get_person_box(signing_priv_key_pem,
|
||||
originDomain,
|
||||
base_dir, session, wfRequest,
|
||||
base_dir, session, wf_request,
|
||||
person_cache, project_version,
|
||||
http_prefix, fromNickname,
|
||||
fromDomain, postToBox,
|
||||
|
|
10
skills.py
10
skills.py
|
@ -207,18 +207,18 @@ def send_skill_via_server(base_dir: str, session, nickname: str, password: str,
|
|||
handle = http_prefix + '://' + domain_full + '/@' + nickname
|
||||
|
||||
# lookup the inbox for the To handle
|
||||
wfRequest = \
|
||||
wf_request = \
|
||||
webfinger_handle(session, handle, http_prefix,
|
||||
cached_webfingers,
|
||||
domain, project_version, debug, False,
|
||||
signing_priv_key_pem)
|
||||
if not wfRequest:
|
||||
if not wf_request:
|
||||
if debug:
|
||||
print('DEBUG: skill webfinger failed for ' + handle)
|
||||
return 1
|
||||
if not isinstance(wfRequest, dict):
|
||||
if not isinstance(wf_request, dict):
|
||||
print('WARN: skill webfinger for ' + handle +
|
||||
' did not return a dict. ' + str(wfRequest))
|
||||
' did not return a dict. ' + str(wf_request))
|
||||
return 1
|
||||
|
||||
postToBox = 'outbox'
|
||||
|
@ -228,7 +228,7 @@ def send_skill_via_server(base_dir: str, session, nickname: str, password: str,
|
|||
(inboxUrl, pubKeyId, pubKey, fromPersonId, sharedInbox, avatarUrl,
|
||||
displayName, _) = get_person_box(signing_priv_key_pem,
|
||||
originDomain,
|
||||
base_dir, session, wfRequest,
|
||||
base_dir, session, wf_request,
|
||||
person_cache, project_version,
|
||||
http_prefix, nickname, domain,
|
||||
postToBox, 76121)
|
||||
|
|
10
socnet.py
10
socnet.py
|
@ -51,23 +51,23 @@ def instances_graph(base_dir: str, handles: str,
|
|||
|
||||
domain_full = get_full_domain(domain, port)
|
||||
handle = http_prefix + "://" + domain_full + "/@" + nickname
|
||||
wfRequest = \
|
||||
wf_request = \
|
||||
webfinger_handle(session, handle, http_prefix,
|
||||
cached_webfingers,
|
||||
domain, project_version, debug, False,
|
||||
signing_priv_key_pem)
|
||||
if not wfRequest:
|
||||
if not wf_request:
|
||||
return dotGraphStr + '}\n'
|
||||
if not isinstance(wfRequest, dict):
|
||||
if not isinstance(wf_request, dict):
|
||||
print('Webfinger for ' + handle + ' did not return a dict. ' +
|
||||
str(wfRequest))
|
||||
str(wf_request))
|
||||
return dotGraphStr + '}\n'
|
||||
|
||||
originDomain = None
|
||||
(personUrl, pubKeyId, pubKey, personId, shaedInbox, avatarUrl,
|
||||
displayName, _) = get_person_box(signing_priv_key_pem,
|
||||
originDomain,
|
||||
base_dir, session, wfRequest,
|
||||
base_dir, session, wf_request,
|
||||
person_cache,
|
||||
project_version, http_prefix,
|
||||
nickname, domain, 'outbox',
|
||||
|
|
|
@ -33,7 +33,7 @@ from session import create_session
|
|||
def html_moderation(css_cache: {}, default_timeline: str,
|
||||
recent_posts_cache: {}, max_recent_posts: int,
|
||||
translate: {}, pageNumber: int, itemsPerPage: int,
|
||||
session, base_dir: str, wfRequest: {}, person_cache: {},
|
||||
session, base_dir: str, wf_request: {}, person_cache: {},
|
||||
nickname: str, domain: str, port: int, inboxJson: {},
|
||||
allow_deletion: bool,
|
||||
http_prefix: str, project_version: str,
|
||||
|
@ -63,7 +63,7 @@ def html_moderation(css_cache: {}, default_timeline: str,
|
|||
recent_posts_cache, max_recent_posts,
|
||||
translate, pageNumber,
|
||||
itemsPerPage, session, base_dir,
|
||||
wfRequest, person_cache,
|
||||
wf_request, person_cache,
|
||||
nickname, domain, port, inboxJson, 'moderation',
|
||||
allow_deletion, http_prefix,
|
||||
project_version, True, False,
|
||||
|
|
Loading…
Reference in New Issue