From d76871218133699e09f19812bce1410052bcdb04 Mon Sep 17 00:00:00 2001 From: dicijr <42663206+dicijr@users.noreply.github.com> Date: Wed, 15 May 2019 02:09:39 -0400 Subject: [PATCH] Heading format --- Calendar/WeatherColumnDesign.py | 4 ++++ Calendar/WeatherHeaderDesign.py | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/Calendar/WeatherColumnDesign.py b/Calendar/WeatherColumnDesign.py index 45b54a5..8387e3e 100644 --- a/Calendar/WeatherColumnDesign.py +++ b/Calendar/WeatherColumnDesign.py @@ -31,6 +31,10 @@ class WeatherColumnDesign (DesignEntity): temperature = forecast.air_temperature + " " + self.__get_unit__(("°C", "°F")) humidity = forecast.air_humidity + "%" if self.forecast.units== "aviation": + if len(forecast.wind_deg)==1: + forecast.wind_deg = "00" + forecast.wind_deg + elif len(forecast.wind_deg)==2: + forecast.wind_deg = "0" + forecast.wind_deg if int(forecast.wind_speed)<10: windspeed = forecast.wind_deg + "@" + "0" + forecast.wind_speed + self.__get_unit__(("", "")) #added degrees, if wind<10 add a 0 to make two digit else: diff --git a/Calendar/WeatherHeaderDesign.py b/Calendar/WeatherHeaderDesign.py index eadcff8..f798843 100644 --- a/Calendar/WeatherHeaderDesign.py +++ b/Calendar/WeatherHeaderDesign.py @@ -30,6 +30,10 @@ class WeatherHeaderDesign (DesignEntity): temperature = cur_weather.air_temperature + " " + self.__get_unit__(("°C", "°F")) if units== "aviation": #pick up aviation + if len(forecast.wind_deg)==1: #if deg is 2, add two zeros for format + forecast.wind_deg = "00" + forecast.wind_deg + elif len(forecast.wind_deg)==2: + forecast.wind_deg = "0" + forecast.wind_deg if int(cur_weather.wind_speed)<10: windspeed = cur_weather.wind_deg + "@" + "0" + cur_weather.wind_speed + self.__get_unit__(("", "")) #added degrees, if wind<10 add a 0 to make two digit else: