mirror of https://gitlab.com/bashrc2/epicyon
Snake case
parent
bb86551e1c
commit
4387e21ba4
|
@ -18,7 +18,7 @@ from utils import getNicknameFromActor
|
||||||
from utils import getDomainFromActor
|
from utils import getDomainFromActor
|
||||||
from utils import load_json
|
from utils import load_json
|
||||||
from utils import getOccupationSkills
|
from utils import getOccupationSkills
|
||||||
from utils import setOccupationSkillsList
|
from utils import set_occupation_skills_list
|
||||||
from utils import acct_dir
|
from utils import acct_dir
|
||||||
from utils import local_actor_url
|
from utils import local_actor_url
|
||||||
from utils import has_actor
|
from utils import has_actor
|
||||||
|
@ -31,7 +31,7 @@ def setSkillsFromDict(actor_json: {}, skillsDict: {}) -> []:
|
||||||
skillsList = []
|
skillsList = []
|
||||||
for name, value in skillsDict.items():
|
for name, value in skillsDict.items():
|
||||||
skillsList.append(name + ':' + str(value))
|
skillsList.append(name + ':' + str(value))
|
||||||
setOccupationSkillsList(actor_json, skillsList)
|
set_occupation_skills_list(actor_json, skillsList)
|
||||||
return skillsList
|
return skillsList
|
||||||
|
|
||||||
|
|
||||||
|
|
18
utils.py
18
utils.py
|
@ -2785,7 +2785,7 @@ def setOccupationName(actor_json: {}, name: str) -> bool:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
def setOccupationSkillsList(actor_json: {}, skillsList: []) -> bool:
|
def set_occupation_skills_list(actor_json: {}, skills_list: []) -> bool:
|
||||||
"""Sets the occupation skills for an actor
|
"""Sets the occupation skills for an actor
|
||||||
"""
|
"""
|
||||||
if 'hasOccupation' not in actor_json:
|
if 'hasOccupation' not in actor_json:
|
||||||
|
@ -2793,24 +2793,24 @@ def setOccupationSkillsList(actor_json: {}, skillsList: []) -> bool:
|
||||||
if not isinstance(actor_json['hasOccupation'], list):
|
if not isinstance(actor_json['hasOccupation'], list):
|
||||||
return False
|
return False
|
||||||
for index in range(len(actor_json['hasOccupation'])):
|
for index in range(len(actor_json['hasOccupation'])):
|
||||||
occupationItem = actor_json['hasOccupation'][index]
|
occupation_item = actor_json['hasOccupation'][index]
|
||||||
if not isinstance(occupationItem, dict):
|
if not isinstance(occupation_item, dict):
|
||||||
continue
|
continue
|
||||||
if not occupationItem.get('@type'):
|
if not occupation_item.get('@type'):
|
||||||
continue
|
continue
|
||||||
if occupationItem['@type'] != 'Occupation':
|
if occupation_item['@type'] != 'Occupation':
|
||||||
continue
|
continue
|
||||||
occupationItem['skills'] = skillsList
|
occupation_item['skills'] = skills_list
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
def is_account_dir(dirName: str) -> bool:
|
def is_account_dir(dir_name: str) -> bool:
|
||||||
"""Is the given directory an account within /accounts ?
|
"""Is the given directory an account within /accounts ?
|
||||||
"""
|
"""
|
||||||
if '@' not in dirName:
|
if '@' not in dir_name:
|
||||||
return False
|
return False
|
||||||
if 'inbox@' in dirName or 'news@' in dirName:
|
if 'inbox@' in dir_name or 'news@' in dir_name:
|
||||||
return False
|
return False
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue