From d3736330e747de799110e1931b5513555c39cf55 Mon Sep 17 00:00:00 2001 From: Jeremy M Crews Date: Thu, 4 Jul 2024 17:19:01 -0700 Subject: [PATCH] okay just normal --- scripts/update_blueprints.py | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/scripts/update_blueprints.py b/scripts/update_blueprints.py index eccbc57..08213e3 100644 --- a/scripts/update_blueprints.py +++ b/scripts/update_blueprints.py @@ -1,7 +1,6 @@ import os import subprocess from datetime import datetime -import urllib.parse # Directory containing blueprint files blueprint_directory = 'automations' @@ -18,13 +17,6 @@ def get_last_commit_date(file_path): date = datetime.strptime(result.stdout.strip(), '%a %b %d %H:%M:%S %Y %z') return date.strftime('%Y-%m-%d') -def generate_shield_url(label, message, color): - """Generate a shields.io URL for a custom badge.""" - label = urllib.parse.quote(label) - message = urllib.parse.quote(message) - color = urllib.parse.quote(color) - return f"https://img.shields.io/badge/{label}-{message}-{color}" - def get_blueprints(directory, ignore_folder): """Retrieve the list of blueprint files in the directory, ignoring specified folders.""" blueprints = [] @@ -36,10 +28,9 @@ def get_blueprints(directory, ignore_folder): name = os.path.splitext(filename)[0] formatted_name = ' '.join(word.capitalize() for word in name.split('_')) last_commit_date = get_last_commit_date(filepath) - shield_url = generate_shield_url("Last updated", last_commit_date, "blue") readme_url = f"https://github.com/asucrews/ha-blueprints/blob/main/{root}/{name}/README.md" - print(f"File: {filename}, Last Commit Date: {last_commit_date}, Shield URL: {shield_url}, README URL: {readme_url}") # Debug print statement - blueprints.append(f"- {formatted_name} [![Last updated]({shield_url})]({readme_url})") + print(f"File: {filename}, Last Commit Date: {last_commit_date}, README URL: {readme_url}") # Debug print statement + blueprints.append(f"- [{formatted_name}]({readme_url}) (Last updated: {last_commit_date})") return blueprints def update_readme(blueprints, readme_path):