mirror of
https://github.com/LucasVbr/LucasVbr.git
synced 2026-07-09 14:27:46 +00:00
Fix data file not found
This commit is contained in:
@@ -38,14 +38,14 @@ I'm Lucàs, a passionate developer from Rodez, France.
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
<div align="center">
|
<center>
|
||||||
|
|
||||||
This README is generated every day.<br>
|
This README is generated every day.<br>
|
||||||
Last refresh: **Saturday 04 June 22, 22:25**<br>
|
Last refresh: **Saturday 04 June 22, 22:36**<br>
|
||||||

|

|
||||||

|

|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
*inspired by [Thomas Guibert](https://github.com/thmsgbrt)*
|
*inspired by [Thomas Guibert](https://github.com/thmsgbrt)*
|
||||||
|
|
||||||
</div>
|
</center>
|
||||||
@@ -11,33 +11,29 @@ from FileUtils import *
|
|||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
|
||||||
TEMPLATE_FILE = "index.md.jinja"
|
TEMPLATE_FILE = "index.md.jinja"
|
||||||
DATA_FILE = "data.old.json"
|
|
||||||
TOOLS_DATA = "tools.json"
|
TOOLS_DATA = "tools.json"
|
||||||
OUTPUT_FILE = "README.md"
|
OUTPUT_FILE = "README.md"
|
||||||
|
|
||||||
app = flask.Flask('my app')
|
app = flask.Flask('my app')
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
# Get Data from JSON
|
# Get tools badges
|
||||||
data = getJsonData(DATA_FILE)
|
|
||||||
|
|
||||||
toolsData = getJsonData(TOOLS_DATA)
|
toolsData = getJsonData(TOOLS_DATA)
|
||||||
tools = [Badge(toolName) for toolName in toolsData]
|
tools = [Badge(toolName) for toolName in toolsData]
|
||||||
|
|
||||||
tools.sort(key=getBadgeColor) # Sort by color
|
tools.sort(key=getBadgeColor) # Sort by color
|
||||||
|
|
||||||
|
# Get Weather
|
||||||
request = requests.get("https://goweather.herokuapp.com/weather/rodez")
|
request = requests.get("https://goweather.herokuapp.com/weather/rodez")
|
||||||
|
|
||||||
weather_status = request.status_code
|
weather_status = request.status_code
|
||||||
weather = request.json()
|
weather = request.json()
|
||||||
|
|
||||||
|
# Get current datetime
|
||||||
today = datetime.today().strftime("%A %d %B %y, %H:%M")
|
today = datetime.today().strftime("%A %d %B %y, %H:%M")
|
||||||
|
|
||||||
# Build from template and data
|
# Build from template and data
|
||||||
with app.app_context():
|
with app.app_context():
|
||||||
rendered = render_template(
|
rendered = render_template(
|
||||||
TEMPLATE_FILE,
|
TEMPLATE_FILE,
|
||||||
# data=data,
|
|
||||||
tools=tools,
|
tools=tools,
|
||||||
weather_status=weather_status,
|
weather_status=weather_status,
|
||||||
weather=weather,
|
weather=weather,
|
||||||
|
|||||||
Reference in New Issue
Block a user