mirror of https://gitlab.com/bashrc2/epicyon
Snake case
parent
e58e1435d5
commit
b399bdc5ee
|
@ -14,7 +14,7 @@ from utils import has_object_stringType
|
|||
from utils import remove_domain_port
|
||||
from utils import has_users_path
|
||||
from utils import get_full_domain
|
||||
from utils import getFollowersList
|
||||
from utils import get_followers_list
|
||||
from utils import validNickname
|
||||
from utils import domainPermitted
|
||||
from utils import getDomainFromActor
|
||||
|
@ -197,9 +197,9 @@ def getMutualsOfPerson(base_dir: str,
|
|||
i.e. accounts which they follow and which also follow back
|
||||
"""
|
||||
followers = \
|
||||
getFollowersList(base_dir, nickname, domain, 'followers.txt')
|
||||
get_followers_list(base_dir, nickname, domain, 'followers.txt')
|
||||
following = \
|
||||
getFollowersList(base_dir, nickname, domain, 'following.txt')
|
||||
get_followers_list(base_dir, nickname, domain, 'following.txt')
|
||||
mutuals = []
|
||||
for handle in following:
|
||||
if handle in followers:
|
||||
|
|
6
posts.py
6
posts.py
|
@ -49,7 +49,7 @@ from utils import isPublicPost
|
|||
from utils import has_users_path
|
||||
from utils import valid_post_date
|
||||
from utils import get_full_domain
|
||||
from utils import getFollowersList
|
||||
from utils import get_followers_list
|
||||
from utils import isEvil
|
||||
from utils import getStatusNumber
|
||||
from utils import createPersonDir
|
||||
|
@ -4348,9 +4348,9 @@ def _getNonMutualsOfPerson(base_dir: str,
|
|||
i.e. accounts which follow you but you don't follow them
|
||||
"""
|
||||
followers = \
|
||||
getFollowersList(base_dir, nickname, domain, 'followers.txt')
|
||||
get_followers_list(base_dir, nickname, domain, 'followers.txt')
|
||||
following = \
|
||||
getFollowersList(base_dir, nickname, domain, 'following.txt')
|
||||
get_followers_list(base_dir, nickname, domain, 'following.txt')
|
||||
nonMutuals = []
|
||||
for handle in followers:
|
||||
if handle not in following:
|
||||
|
|
16
utils.py
16
utils.py
|
@ -548,12 +548,12 @@ def isSuspended(base_dir: str, nickname: str) -> bool:
|
|||
return False
|
||||
|
||||
|
||||
def getFollowersList(base_dir: str,
|
||||
nickname: str, domain: str,
|
||||
followFile='following.txt') -> []:
|
||||
def get_followers_list(base_dir: str,
|
||||
nickname: str, domain: str,
|
||||
follow_file='following.txt') -> []:
|
||||
"""Returns a list of followers for the given account
|
||||
"""
|
||||
filename = acct_dir(base_dir, nickname, domain) + '/' + followFile
|
||||
filename = acct_dir(base_dir, nickname, domain) + '/' + follow_file
|
||||
|
||||
if not os.path.isfile(filename):
|
||||
return []
|
||||
|
@ -587,10 +587,10 @@ def get_followers_of_person(base_dir: str,
|
|||
if not os.path.isfile(filename):
|
||||
continue
|
||||
with open(filename, 'r') as followingfile:
|
||||
for followingHandle in followingfile:
|
||||
followingHandle2 = followingHandle.replace('\n', '')
|
||||
followingHandle2 = followingHandle2.replace('\r', '')
|
||||
if followingHandle2 == handle:
|
||||
for following_handle in followingfile:
|
||||
following_handle2 = following_handle.replace('\n', '')
|
||||
following_handle2 = following_handle2.replace('\r', '')
|
||||
if following_handle2 == handle:
|
||||
if account not in followers:
|
||||
followers.append(account)
|
||||
break
|
||||
|
|
Loading…
Reference in New Issue