From 8e97a62ccae714b92d962900039bbe7e90399ad5 Mon Sep 17 00:00:00 2001 From: Jean-Kevin KPADEY Date: Sun, 14 Jan 2024 09:04:52 +0100 Subject: [PATCH 1/3] Fix the calm wind regex This PR fixes #61 and the regex of the calm wind which is represented by `00000KT` and not `0000KT`. Visibility should not be parsed aas wind. --- metar_taf_parser/command/common.py | 2 +- metar_taf_parser/tests/parser/test_parser.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/metar_taf_parser/command/common.py b/metar_taf_parser/command/common.py index 4fcaf20..d6efb42 100644 --- a/metar_taf_parser/command/common.py +++ b/metar_taf_parser/command/common.py @@ -79,7 +79,7 @@ def execute(self, container: AbstractWeatherContainer, visibility_string: str): class WindCommand: - regex = r'^(VRB|00|[0-3]\d{2})(\d{2})G?(\d{2,3})?(KT|MPS|KM\/H)?' + regex = r'^(VRB|000|[0-3]\d{2})(\d{2})G?(\d{2,3})?(KT|MPS|KM\/H)?' def __init__(self): self._pattern = re.compile(WindCommand.regex) diff --git a/metar_taf_parser/tests/parser/test_parser.py b/metar_taf_parser/tests/parser/test_parser.py index 4cf29d2..a409060 100644 --- a/metar_taf_parser/tests/parser/test_parser.py +++ b/metar_taf_parser/tests/parser/test_parser.py @@ -290,7 +290,7 @@ def test_parse_runway_deposit(self): def test_parse_empty_wind(self): - metar = MetarParser().parse('KATW 022045Z 0000KT 10SM SCT120 00/M08 A2996') + metar = MetarParser().parse('KATW 022045Z 00000KT 10SM SCT120 00/M08 A2996') self.assertEqual('KATW', metar.station) self.assertIsNotNone(metar.wind) From dbfae3cd618c37ce92f2d25203a79c115303c2ef Mon Sep 17 00:00:00 2001 From: Jean-Kevin KPADEY Date: Sat, 13 Jan 2024 23:12:21 +0100 Subject: [PATCH 2/3] Fix the French translation Single quotes were doubled. --- .../locale/fr/LC_MESSAGES/messages.mo | Bin 17493 -> 17485 bytes .../locale/fr/LC_MESSAGES/messages.po | 10 +++++----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/metar_taf_parser/locale/fr/LC_MESSAGES/messages.mo b/metar_taf_parser/locale/fr/LC_MESSAGES/messages.mo index 2273e9211765c8e1a6eeedce8949756750f0ffc0..e3524c25165a4d0968b00b0d7396b1a3011eac19 100644 GIT binary patch delta 2230 zcmXZcdrZ}J7{~E1CsE{ZJtznS9ZsitoCg(Dgp$KWm{e-DRXR#VtD)v?US=8f>*ms7 z4%FJ5bJk2ZT1Ml{&E{6CRiw>D7w6?4WUCchnV0;-gsu07-?Op3zL($c`98nr`y4Lp zPC36j<+HtM-dX2d!*u6D7>ql250>J+7{Lsz!%SRc^HvNpZ#TEvx@Ydi@$4V6`3E?G z`AM6fLdE+!?!2*$0Tw2)a0wOoZ&V_8Fat+zJ-ytyam@2E4U18MqL_`9Sb~k1j%}zo zFQO9Igo?idGx4o*&$)>Vx^3YwDsT^`Vjt$L$YNtH>Pug;ja}ve^Fvg?Uh|ZB#{A0cH_xLI{RNfS5b8>XQRiGo zCFG6TM&V3cBzU{|lASP2`F^ z_n&Q~&T=lsMi47;4&I0Dr~vO^E*?bP;R#gJ_F)!&i$(Y=>iK_AA2Nb-u&}~^ZV8q$ zUygG*-*qt17xdZ2In)cosNN_g8{Ksb_2m_)QdXgwtQNDe1$EcUP?cDZ`M3pD>OH9U zj$;Tv!F0}dU)shw^C#4Smr!3agt>UlbhG`+gir@nn$>0kl~9w-pF|zpii)$!*0-Xk zFMpXq9(H30kK=qiZQe!&sH80Fff{@imtqu;;ZyiM>bcUn{&NrDLgou>-ic2z@4@MK zSM{%FFty4r^%_)3x1bVv6;<*s9P|3&!-u6hiw?cb}Ydztiw++fY;0$s0#jz`n8N= z4o=``0w*C#O+keD7 z9K=a@3zb+}y`NAnDt-hNcjlNL_rO3IH=}ysX;g--s2AGI4X7{NX}*nmZy)N*j$%H3 zjs-Y?+W!;P%y+ODGa7tjn8x|8iGczyMwMzQs^rh20`5e8QMY*lqs-5s0$xSEKZ2^j z_(s1+im-@z#H_XTWjJ=l=xNZ-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r/LC_MESSAGES/messages.po index 3642826..07aa940 100644 --- a/metar_taf_parser/locale/fr/LC_MESSAGES/messages.po +++ b/metar_taf_parser/locale/fr/LC_MESSAGES/messages.po @@ -536,7 +536,7 @@ msgstr "température horaire de {0}°C et point de rosée de {1}°C" #: msgid "Remark.Ice.Accretion.Amount" -msgstr "{0}/100 d''un pouce d''accrétion de glace au cours des {1} dernières heures" +msgstr "{0}/100 d'un pouce d'accrétion de glace au cours des {1} dernières heures" #: msgid "Remark.HVY" @@ -572,7 +572,7 @@ msgstr "vent de pointe de {1} noeuds en provenance de {0} degrés à {2}:{3}" #: msgid "Remark.Precipitation.Amount.Hourly" -msgstr "{0}/100 d''un pouce de précipitation est tombé au cours de la dernière heure" +msgstr "{0}/100 d'un pouce de précipitation est tombé au cours de la dernière heure" #: msgid "Remark.Precipitation.Amount.3.6" @@ -636,7 +636,7 @@ msgstr "{0} grésil" #: msgid "Remark.Sunshine.Duration" -msgstr "{0} minutes d''ensoleillement" +msgstr "{0} minutes d'ensoleillement" #: msgid "Remark.Surface.Visibility" @@ -696,7 +696,7 @@ msgstr "trombe" #: msgid "Remark.Water.Equivalent.Snow.Ground" -msgstr "équivalent d''eau de {0} pouces de neige" +msgstr "équivalent d'eau de {0} pouces de neige" #: msgid "Remark.WindShift" @@ -704,7 +704,7 @@ msgstr "changement de vent à {0}:{1}" #: msgid "Remark.WindShift.FROPA" -msgstr "changement de vent accompagné d''un passage de front à {0}:{1}" +msgstr "changement de vent accompagné d'un passage de front à {0}:{1}" #: msgid "MetarFacade.InvalidIcao" From 9721b04d919961a8caa80225fe32232930b85fd3 Mon Sep 17 00:00:00 2001 From: Jean-Kevin KPADEY Date: Sun, 14 Jan 2024 09:44:01 +0100 Subject: [PATCH 3/3] Bump version to 1.8.2 --- CHANGELOG.md | 7 +++++++ setup.cfg | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 263905c..ffae347 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Change Log +## [1.8.2] - 2024-01-14 + +### Fixed + +- Fix the calm wind regex to prevent parsing error with visibility. +- Fix single quotes in French translations. + ## [1.8.0] - 2024-01-04 ### Added diff --git a/setup.cfg b/setup.cfg index 20c9c85..270774b 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = metar-taf-parser-mivek -version = 1.8.1 +version = 1.8.2 author = Jean-Kevin KPADEY author_email = jeankevin.kpadey@gmail.com description = Python project parsing metar and taf message