From 118cc3156fb43179fed01a27ded83b45ef48eee6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20D=C4=99bowski?= Date: Mon, 9 Jan 2017 12:43:08 +0100 Subject: [PATCH] Added method to show recent weather as string --- metar/Metar.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/metar/Metar.py b/metar/Metar.py index 5f9982b5..721ec5ad 100755 --- a/metar/Metar.py +++ b/metar/Metar.py @@ -1096,8 +1096,20 @@ def present_weather( self ): """ Return a textual description of the present weather. """ + return self._weather( self.weather ) + + def recent_weather( self ): + """ + Return a textual description of the recent weather. + """ + return self._weather( self.recent ) + + def _weather( self, weather ): + """ + Return a textual description of weather. + """ text_list = [] - for weatheri in self.weather: + for weatheri in weather: (inteni,desci,preci,obsci,otheri) = weatheri text_parts = [] code_parts = []