Edit weather emoji, Tools color badge and duplicate tool badges

This commit is contained in:
LucasVbr
2022-06-21 14:14:40 +02:00
parent b10673ccb3
commit 2062f87459
5 changed files with 54 additions and 37 deletions
+31 -31
View File
@@ -1,41 +1,41 @@
[ [
"HTML5", "Android",
"CSS3", "Android Studio",
"JavaScript", "Angular",
"PHP",
"Java",
"C",
"Python",
"GNU Bash",
"Bootstrap", "Bootstrap",
"Bulma", "Bulma",
"Symfony", "C",
"Angular", "CSS3",
"Figma",
"Git",
"MariaDB",
"MySQL",
"PostgreSQL",
"SQLite",
"Android",
"Linux",
"Windows",
"Insomnia",
"JetBrains",
"Visual Studio Code",
"FileZilla",
"Composer", "Composer",
"DataGrip", "DataGrip",
"IntelliJIdea", "Figma",
"PyCharm", "FileZilla",
"Json", "GNU Bash",
"diagrams.net", "Git",
"Android Studio",
"GitHub", "GitHub",
"GitLab", "GitLab",
"HTML5",
"Handlebars.js", "Handlebars.js",
"Pug", "Insomnia",
"IntelliJIdea",
"Java",
"JavaScript",
"JetBrains",
"Jinja", "Jinja",
"Json",
"Linux",
"MariaDB",
"Markdown", "Markdown",
"PhpStorm" "MySQL",
] "PHP",
"PhpStorm",
"PostgreSQL",
"Pug",
"PyCharm",
"Python",
"SQLite",
"Symfony",
"Visual Studio Code",
"Windows",
"diagrams.net"
]
+11 -3
View File
@@ -1,10 +1,10 @@
# coding: utf-8 # coding: utf-8
__author__ = "LucasVbr" __author__ = "LucasVbr"
__version__ = "3.0.0" __version__ = "3.0.3"
from Utils import * from Utils import *
from src.FileUtils import getJsonData from src.FileUtils import getJsonData, setJsonData
from datetime import datetime from datetime import datetime
import pytz import pytz
@@ -14,8 +14,12 @@ if __name__ == "__main__":
configData = getJsonData(CONFIG_FILE) configData = getJsonData(CONFIG_FILE)
data = getDataSubfiles(configData.get("data_files")) data = getDataSubfiles(configData.get("data_files"))
toolList = data.get("tools")
toolList = list(dict.fromkeys(toolList)) # Remove duplicates
data["info"] = configData.get("info") data["info"] = configData.get("info")
data["tools"] = convertToolBadges(data.get("tools")) data["tools"] = convertToolBadges(toolList)
data["weather"] = getWeather(data.get("info").get('city')) data["weather"] = getWeather(data.get("info").get('city'))
data['today'] = datetime \ data['today'] = datetime \
.today() \ .today() \
@@ -27,3 +31,7 @@ if __name__ == "__main__":
configData.get("output_file"), configData.get("output_file"),
data data
) )
# Rewrite Tools (in order)
toolList.sort()
setJsonData("data/tools.json", toolList)
+7 -2
View File
@@ -30,17 +30,22 @@ class Badge:
icon = icons.get(self.name) icon = icons.get(self.name)
color_hue = Color(f'#{icon.hex}').get_hue()
color_hsl = (color_hue, 0.75, 0.5)
color = Color()
color.set_hsl(color_hsl)
try: try:
params = { params = {
"label": "", "label": "",
"message": icon.title, "message": icon.title,
"color": f"#{icon.hex}", "color": color,
"logo": icon.slug, "logo": icon.slug,
"logoColor": LOGO_COLOR "logoColor": LOGO_COLOR
} }
urlParams = urlencode(params) urlParams = urlencode(params)
self.url = f"{BASE_URL}?{urlParams}" self.url = f"{BASE_URL}?{urlParams}"
self.color = Color(params["color"]).get_hue() self.color = color_hue
except Exception: except Exception:
pass # Let default values pass # Let default values
+4
View File
@@ -24,6 +24,10 @@ def getJsonData(filePath: str) -> str:
return data return data
def setJsonData(filePath: str, content) -> None:
setFileData(filePath, json.dumps(content, indent=2))
def setFileData(filePath: str, content: str) -> None: def setFileData(filePath: str, content: str) -> None:
""" """
Create a new File or replace it content if already exist Create a new File or replace it content if already exist
+1 -1
View File
@@ -3,7 +3,7 @@
# Hello there ! {{ imageWithSize(data.info.hi_img) }} # Hello there ! {{ imageWithSize(data.info.hi_img) }}
I'm {{ data.info.name }}, a passionate developer from {{ imageWithSize(data.info.france_img) }} **{{ data.info.city }}, France**. I'm {{ data.info.name }}, a passionate developer from {{ imageWithSize(data.info.france_img) }} **{{ data.info.city }}, France**.
<br>Currently, the weather is: **{{ data.weather.temperature }}°C** :thermometer:, **{{ data.weather.description }}** {% if data.weather.icon == "None" %}{{ data.weather.icon }}{% endif %} <br>Currently, the weather is: **{{ data.weather.temperature }}°C** :thermometer:, **{{ data.weather.description }}** {% if data.weather.icon != "None" %}{{ data.weather.icon }}{% endif %}
### I code with ### I code with
{% for img in data.tools -%} {% for img in data.tools -%}