From 67cfb0e31fd7000c3c24ce7dc1834d21f1de9d95 Mon Sep 17 00:00:00 2001 From: LucasVbr Date: Sat, 4 Jun 2022 22:37:26 +0200 Subject: [PATCH] Fix data file not found --- README.md | 6 +++--- main.py | 10 +++------- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 58d6e48..d3ab907 100644 --- a/README.md +++ b/README.md @@ -38,14 +38,14 @@ I'm Lucàs, a passionate developer from Rodez, France. --- -
+
This README is generated every day.
-Last refresh: **Saturday 04 June 22, 22:25**
+Last refresh: **Saturday 04 June 22, 22:36**
![Profile Views](https://komarev.com/ghpvc/?username=lucasvbr&label=Profile%20views&color=0e75b6&style=flat) ![FreeCodeCamp Points](https://img.shields.io/freecodecamp/points/lucasvbr?label=FreeCodeCamp%20points)
![Made with love](https://img.shields.io/badge/-made%20with%20%E2%9D%A4%EF%B8%8F-red) *inspired by [Thomas Guibert](https://github.com/thmsgbrt)* -
\ No newline at end of file + \ No newline at end of file diff --git a/main.py b/main.py index 81f9a05..9749620 100644 --- a/main.py +++ b/main.py @@ -11,33 +11,29 @@ from FileUtils import * from datetime import datetime TEMPLATE_FILE = "index.md.jinja" -DATA_FILE = "data.old.json" TOOLS_DATA = "tools.json" OUTPUT_FILE = "README.md" app = flask.Flask('my app') if __name__ == "__main__": - # Get Data from JSON - data = getJsonData(DATA_FILE) - + # Get tools badges toolsData = getJsonData(TOOLS_DATA) tools = [Badge(toolName) for toolName in toolsData] - tools.sort(key=getBadgeColor) # Sort by color + # Get Weather request = requests.get("https://goweather.herokuapp.com/weather/rodez") - weather_status = request.status_code weather = request.json() + # Get current datetime today = datetime.today().strftime("%A %d %B %y, %H:%M") # Build from template and data with app.app_context(): rendered = render_template( TEMPLATE_FILE, - # data=data, tools=tools, weather_status=weather_status, weather=weather,