mirror of https://gitlab.com/bashrc2/epicyon
Snake case
parent
ad4b988f4c
commit
1b64e604ca
|
@ -66,7 +66,7 @@ from tests import runAllTests
|
|||
from auth import storeBasicCredentials
|
||||
from auth import createPassword
|
||||
from utils import removeDomainPort
|
||||
from utils import getPortFromDomain
|
||||
from utils import get_port_from_domain
|
||||
from utils import has_users_path
|
||||
from utils import get_full_domain
|
||||
from utils import setConfigParam
|
||||
|
@ -1277,7 +1277,7 @@ if args.message:
|
|||
toDomain = toDomain.replace('\n', '').replace('\r', '')
|
||||
toPort = 443
|
||||
if ':' in toDomain:
|
||||
toPort = getPortFromDomain(toDomain)
|
||||
toPort = get_port_from_domain(toDomain)
|
||||
toDomain = removeDomainPort(toDomain)
|
||||
else:
|
||||
if args.sendto.endswith('followers'):
|
||||
|
|
4
inbox.py
4
inbox.py
|
@ -31,7 +31,7 @@ from utils import get_user_paths
|
|||
from utils import get_base_content_from_post
|
||||
from utils import acct_dir
|
||||
from utils import removeDomainPort
|
||||
from utils import getPortFromDomain
|
||||
from utils import get_port_from_domain
|
||||
from utils import has_object_dict
|
||||
from utils import dmAllowedFromDomain
|
||||
from utils import isRecentPost
|
||||
|
@ -2830,7 +2830,7 @@ def _bounceDM(senderPostId: str, session, http_prefix: str,
|
|||
senderDomain = sendingHandle.split('@')[1]
|
||||
senderPort = port
|
||||
if ':' in senderDomain:
|
||||
senderPort = getPortFromDomain(senderDomain)
|
||||
senderPort = get_port_from_domain(senderDomain)
|
||||
senderDomain = removeDomainPort(senderDomain)
|
||||
cc = []
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ from follow import followedAccountRejects
|
|||
from follow import removeFromFollowRequests
|
||||
from utils import load_json
|
||||
from utils import removeDomainPort
|
||||
from utils import getPortFromDomain
|
||||
from utils import get_port_from_domain
|
||||
from utils import get_user_paths
|
||||
from utils import acct_dir
|
||||
from threads import threadWithTrace
|
||||
|
@ -57,7 +57,7 @@ def manualDenyFollowRequest(session, base_dir: str,
|
|||
denyHandle.split('@')[1].replace('\n', '').replace('\r', '')
|
||||
denyPort = port
|
||||
if ':' in denyDomain:
|
||||
denyPort = getPortFromDomain(denyDomain)
|
||||
denyPort = get_port_from_domain(denyDomain)
|
||||
denyDomain = removeDomainPort(denyDomain)
|
||||
followedAccountRejects(session, base_dir, http_prefix,
|
||||
nickname, domain, port,
|
||||
|
@ -185,7 +185,7 @@ def manualApproveFollowRequest(session, base_dir: str,
|
|||
handleOfFollowRequester.replace('\r', '')
|
||||
port2 = port
|
||||
if ':' in handleOfFollowRequester:
|
||||
port2 = getPortFromDomain(handleOfFollowRequester)
|
||||
port2 = get_port_from_domain(handleOfFollowRequester)
|
||||
requestsDir = accountDir + '/requests'
|
||||
followActivityfilename = \
|
||||
requestsDir + '/' + handleOfFollowRequester + '.follow'
|
||||
|
@ -200,7 +200,8 @@ def manualApproveFollowRequest(session, base_dir: str,
|
|||
approveDomain.replace('\r', '')
|
||||
approvePort = port2
|
||||
if ':' in approveDomain:
|
||||
approvePort = getPortFromDomain(approveDomain)
|
||||
approvePort = \
|
||||
get_port_from_domain(approveDomain)
|
||||
approveDomain = removeDomainPort(approveDomain)
|
||||
print('Manual follow accept: Sending Accept for ' +
|
||||
handle + ' follow request from ' +
|
||||
|
|
4
posts.py
4
posts.py
|
@ -40,7 +40,7 @@ from utils import replace_users_with_at
|
|||
from utils import has_group_type
|
||||
from utils import get_base_content_from_post
|
||||
from utils import removeDomainPort
|
||||
from utils import getPortFromDomain
|
||||
from utils import get_port_from_domain
|
||||
from utils import has_object_dict
|
||||
from utils import rejectPostId
|
||||
from utils import removeInvalidChars
|
||||
|
@ -3171,7 +3171,7 @@ def sendToFollowers(session, base_dir: str,
|
|||
index = 0
|
||||
toDomain = followerHandles[index].split('@')[1]
|
||||
if ':' in toDomain:
|
||||
toPort = getPortFromDomain(toDomain)
|
||||
toPort = get_port_from_domain(toDomain)
|
||||
toDomain = removeDomainPort(toDomain)
|
||||
|
||||
cc = ''
|
||||
|
|
4
utils.py
4
utils.py
|
@ -1097,7 +1097,7 @@ def getDomainFromActor(actor: str) -> (str, int):
|
|||
if '/' in actor:
|
||||
domain = domain.split('/')[0]
|
||||
if ':' in domain:
|
||||
port = getPortFromDomain(domain)
|
||||
port = get_port_from_domain(domain)
|
||||
domain = removeDomainPort(domain)
|
||||
return domain, port
|
||||
|
||||
|
@ -2920,7 +2920,7 @@ def removeDomainPort(domain: str) -> str:
|
|||
return domain
|
||||
|
||||
|
||||
def getPortFromDomain(domain: str) -> int:
|
||||
def get_port_from_domain(domain: str) -> int:
|
||||
"""If the domain has a port number appended then return it
|
||||
eg. mydomain.com:80 returns 80
|
||||
"""
|
||||
|
|
Loading…
Reference in New Issue