mirror of
https://github.com/LucasVbr/LucasVbr.git
synced 2026-05-13 17:11:52 +00:00
Edit weather emoji, Tools color badge and duplicate tool badges
This commit is contained in:
+31
-31
@@ -1,41 +1,41 @@
|
||||
[
|
||||
"HTML5",
|
||||
"CSS3",
|
||||
"JavaScript",
|
||||
"PHP",
|
||||
"Java",
|
||||
"C",
|
||||
"Python",
|
||||
"GNU Bash",
|
||||
"Android",
|
||||
"Android Studio",
|
||||
"Angular",
|
||||
"Bootstrap",
|
||||
"Bulma",
|
||||
"Symfony",
|
||||
"Angular",
|
||||
"Figma",
|
||||
"Git",
|
||||
"MariaDB",
|
||||
"MySQL",
|
||||
"PostgreSQL",
|
||||
"SQLite",
|
||||
"Android",
|
||||
"Linux",
|
||||
"Windows",
|
||||
"Insomnia",
|
||||
"JetBrains",
|
||||
"Visual Studio Code",
|
||||
"FileZilla",
|
||||
"C",
|
||||
"CSS3",
|
||||
"Composer",
|
||||
"DataGrip",
|
||||
"IntelliJIdea",
|
||||
"PyCharm",
|
||||
"Json",
|
||||
"diagrams.net",
|
||||
"Android Studio",
|
||||
"Figma",
|
||||
"FileZilla",
|
||||
"GNU Bash",
|
||||
"Git",
|
||||
"GitHub",
|
||||
"GitLab",
|
||||
"HTML5",
|
||||
"Handlebars.js",
|
||||
"Pug",
|
||||
"Insomnia",
|
||||
"IntelliJIdea",
|
||||
"Java",
|
||||
"JavaScript",
|
||||
"JetBrains",
|
||||
"Jinja",
|
||||
"Json",
|
||||
"Linux",
|
||||
"MariaDB",
|
||||
"Markdown",
|
||||
"PhpStorm"
|
||||
]
|
||||
"MySQL",
|
||||
"PHP",
|
||||
"PhpStorm",
|
||||
"PostgreSQL",
|
||||
"Pug",
|
||||
"PyCharm",
|
||||
"Python",
|
||||
"SQLite",
|
||||
"Symfony",
|
||||
"Visual Studio Code",
|
||||
"Windows",
|
||||
"diagrams.net"
|
||||
]
|
||||
@@ -1,10 +1,10 @@
|
||||
# coding: utf-8
|
||||
|
||||
__author__ = "LucasVbr"
|
||||
__version__ = "3.0.0"
|
||||
__version__ = "3.0.3"
|
||||
|
||||
from Utils import *
|
||||
from src.FileUtils import getJsonData
|
||||
from src.FileUtils import getJsonData, setJsonData
|
||||
from datetime import datetime
|
||||
import pytz
|
||||
|
||||
@@ -14,8 +14,12 @@ if __name__ == "__main__":
|
||||
configData = getJsonData(CONFIG_FILE)
|
||||
|
||||
data = getDataSubfiles(configData.get("data_files"))
|
||||
|
||||
toolList = data.get("tools")
|
||||
toolList = list(dict.fromkeys(toolList)) # Remove duplicates
|
||||
|
||||
data["info"] = configData.get("info")
|
||||
data["tools"] = convertToolBadges(data.get("tools"))
|
||||
data["tools"] = convertToolBadges(toolList)
|
||||
data["weather"] = getWeather(data.get("info").get('city'))
|
||||
data['today'] = datetime \
|
||||
.today() \
|
||||
@@ -27,3 +31,7 @@ if __name__ == "__main__":
|
||||
configData.get("output_file"),
|
||||
data
|
||||
)
|
||||
|
||||
# Rewrite Tools (in order)
|
||||
toolList.sort()
|
||||
setJsonData("data/tools.json", toolList)
|
||||
|
||||
+7
-2
@@ -30,17 +30,22 @@ class Badge:
|
||||
|
||||
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:
|
||||
params = {
|
||||
"label": "",
|
||||
"message": icon.title,
|
||||
"color": f"#{icon.hex}",
|
||||
"color": color,
|
||||
"logo": icon.slug,
|
||||
"logoColor": LOGO_COLOR
|
||||
}
|
||||
urlParams = urlencode(params)
|
||||
self.url = f"{BASE_URL}?{urlParams}"
|
||||
self.color = Color(params["color"]).get_hue()
|
||||
self.color = color_hue
|
||||
except Exception:
|
||||
pass # Let default values
|
||||
|
||||
|
||||
@@ -24,6 +24,10 @@ def getJsonData(filePath: str) -> str:
|
||||
return data
|
||||
|
||||
|
||||
def setJsonData(filePath: str, content) -> None:
|
||||
setFileData(filePath, json.dumps(content, indent=2))
|
||||
|
||||
|
||||
def setFileData(filePath: str, content: str) -> None:
|
||||
"""
|
||||
Create a new File or replace it content if already exist
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
# 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**.
|
||||
<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
|
||||
{% for img in data.tools -%}
|
||||
|
||||
Reference in New Issue
Block a user