mirror of
https://github.com/LucasVbr/LucasVbr.git
synced 2026-07-09 14:27:46 +00:00
Add more informations about me and animated emojis
This commit is contained in:
+4
-10
@@ -1,7 +1,7 @@
|
||||
import yaml
|
||||
from src.model.skill_list import SkillList
|
||||
from src.model.skill_list import skill_list
|
||||
import requests
|
||||
from src.model.social_list import SocialList
|
||||
from src.model.social_list import social_list
|
||||
|
||||
|
||||
class Config:
|
||||
@@ -22,16 +22,10 @@ class Config:
|
||||
raise Exception("User not found")
|
||||
self.config_data["user"] = response.json()
|
||||
|
||||
def handle_skill_section(self):
|
||||
self.config_data["skills"] = str(SkillList(self.config_data["skills"]))
|
||||
|
||||
def handle_social_section(self):
|
||||
self.config_data["socials"] = str(SocialList(self.config_data["socials"]))
|
||||
|
||||
def get_data(self):
|
||||
self.load_config_file()
|
||||
self.handle_user_info()
|
||||
self.handle_skill_section()
|
||||
self.handle_social_section()
|
||||
self.config_data["skills"] = skill_list(self.config_data["skills"])
|
||||
self.config_data["socials"] = social_list(self.config_data["socials"])
|
||||
|
||||
return self.config_data
|
||||
|
||||
+7
-11
@@ -1,15 +1,11 @@
|
||||
from src.model.skill import Skill
|
||||
|
||||
|
||||
class SkillList:
|
||||
skills: list[Skill]
|
||||
def skill_list(skills: list[str]) -> dict[str, str]:
|
||||
# Sort and remove duplicates
|
||||
skills = list(set(skills))
|
||||
skills.sort()
|
||||
|
||||
def __init__(self, skills: list[str]):
|
||||
# Sort and remove duplicates
|
||||
skills = list(set(skills))
|
||||
skills.sort()
|
||||
|
||||
self.skills = [Skill(skill) for skill in skills]
|
||||
|
||||
def __str__(self) -> str:
|
||||
return "\n".join([str(skill) for skill in self.skills])
|
||||
skills = {skill: Skill(skill).__str__() for skill in skills}
|
||||
skills["all"] = "\n".join([str(skill) for skill in skills.values()])
|
||||
return skills
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
from src.model.social import Social
|
||||
|
||||
|
||||
class SocialList:
|
||||
socials: list[Social]
|
||||
|
||||
def __init__(self, socials: list):
|
||||
self.socials = [Social(social.get("name"), social.get("url")) for social in socials]
|
||||
|
||||
def __str__(self) -> str:
|
||||
return "\n".join([str(social) for social in self.socials])
|
||||
def social_list(socials: list) -> dict[str, str]:
|
||||
socials: dict[str, str] = {social.get("name"): str(Social(social.get("name"), social.get("url"))) for social in
|
||||
socials}
|
||||
socials["all"] = "\n".join([str(social) for social in socials.values()])
|
||||
return socials
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@ class Template:
|
||||
def __init__(self, template_path: str):
|
||||
self.template_path = template_path
|
||||
|
||||
def render(self, **kwargs) -> str:
|
||||
def render(self, **kwargs):
|
||||
with open(self.template_path, 'r') as f:
|
||||
template = f.read()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user