From d9af103b9a8aed86d6ac834f1240edfb2173ffa0 Mon Sep 17 00:00:00 2001 From: Mitsuo Tokumori Date: Sat, 8 Mar 2025 02:17:52 +0900 Subject: Restructure js and css into single block modules Each block is defined by: * html: front-end elements (modify: templates/index.html) (for now) * css: front-end design (modify: static/style.css) * js: front-end code (new file: static/block_name.js) * python: back-end code (new file: ./block_name.py) (will move later from the root to an "app" directory (python package) --- block_weather.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'block_weather.py') diff --git a/block_weather.py b/block_weather.py index 4443de3..84c0092 100644 --- a/block_weather.py +++ b/block_weather.py @@ -33,7 +33,7 @@ def _format_current_weather(data: dict) -> str: s = f"""{data['name']}, {data['sys']['country']} ({ts[0]}) {data['weather'][0]['description']} {data['main']['temp']}°C (feels like {data['main']['feels_like']}°C), humidity: {data['main']['humidity']}%, pressure: {data['main']['grnd_level']} hPa -visibility: {data['visibility']/1000:.1f}km +visibility: {data.get('visibility', 0)/1000:.1f}km wind: {data['wind']['speed']}m/s from {data['wind']['deg']}°N clouds: {data['clouds']['all']}% sunrise & sunset: {ts[1].strftime('%H:%M')}, {ts[2].strftime('%H:%M')}""" -- cgit v1.2.3