diff --git a/metar_taf_parser/command/metar.py b/metar_taf_parser/command/metar.py index 9efc380..faeaa98 100644 --- a/metar_taf_parser/command/metar.py +++ b/metar_taf_parser/command/metar.py @@ -1,6 +1,7 @@ import re from metar_taf_parser.commons import converter +from metar_taf_parser.commons.exception import ParseError from metar_taf_parser.model.enum import DepositType, DepositCoverage from metar_taf_parser.model.model import RunwayInfo, Metar from metar_taf_parser.commons.i18n import _ @@ -41,6 +42,22 @@ def execute(self, metar: Metar, input: str): metar.altimeter = int(converter.convert_inches_mercury_to_pascal(mercury)) +def _parse_runway(matches, metar, runway): + runway.name = matches[0][0] + runway.indicator = matches[0][1] + runway.min_range = int(matches[0][2]) + runway.trend = matches[0][3] + metar.add_runway_info(runway) + + +def _parse_runway_max_range(matches, metar, runway): + runway.name = matches[0][0] + runway.min_range = int(matches[0][1]) + runway.max_range = int(matches[0][2]) + runway.trend = matches[0][3] + metar.add_runway_info(runway) + + class RunwayCommand: generic_regex = r'^(R\d{2}\w?/)' runway_max_range_regex = r'^R(\d{2}\w?)/(\d{4})V(\d{3,4})([UDN])?(FT)?' @@ -79,31 +96,29 @@ def can_parse(self, input: str): def execute(self, metar: Metar, input: str): matches = self._runway_deposit_pattern.findall(input) runway = RunwayInfo() - if matches: - runway.name = matches[0][0] - runway.deposit_type = DepositType(matches[0][1]) - runway.coverage = DepositCoverage(matches[0][2]) - runway.thickness = self.__parse_deposit_thickness(matches[0][3]) - runway.braking_capacity = self.__parse_deposit_braking_capacity(matches[0][4]) - metar.add_runway_info(runway) - return - - matches = self._runway_pattern.findall(input) - if matches: - runway.name = matches[0][0] - runway.indicator = matches[0][1] - runway.min_range = int(matches[0][2]) - runway.trend = matches[0][3] - metar.add_runway_info(runway) - return - - matches = self._max_range_pattern.findall(input) - if matches: - runway.name = matches[0][0] - runway.min_range = int(matches[0][1]) - runway.max_range = int(matches[0][2]) - runway.trend = matches[0][3] - metar.add_runway_info(runway) + try: + if matches: + self.__parse_runway_deposit(matches, metar, runway) + return + + matches = self._runway_pattern.findall(input) + if matches: + _parse_runway(matches, metar, runway) + return + + matches = self._max_range_pattern.findall(input) + if matches: + _parse_runway_max_range(matches, metar, runway) + except ValueError: + raise ParseError(_("ErrorCode.IncompleteRunwayInformation")) + + def __parse_runway_deposit(self, matches, metar, runway): + runway.name = matches[0][0] + runway.deposit_type = DepositType(matches[0][1]) + runway.coverage = DepositCoverage(matches[0][2]) + runway.thickness = self.__parse_deposit_thickness(matches[0][3]) + runway.braking_capacity = self.__parse_deposit_braking_capacity(matches[0][4]) + metar.add_runway_info(runway) def __parse_deposit_thickness(self, input): thickness = self._deposit_thickness.get(input, 'DepositThickness.default') diff --git a/metar_taf_parser/commons/exception.py b/metar_taf_parser/commons/exception.py index a39a98e..d2e821a 100644 --- a/metar_taf_parser/commons/exception.py +++ b/metar_taf_parser/commons/exception.py @@ -7,3 +7,11 @@ class TranslationError(Exception): def __init__(self, translation: str, message: str): self.message = message self.translation = translation + + +class ParseError(Exception): + def __init__(self, message: str): + self.__message = message + + def message(self): + return self.__message diff --git a/metar_taf_parser/locale/de/LC_MESSAGES/messages.mo b/metar_taf_parser/locale/de/LC_MESSAGES/messages.mo index 1608b4a..f9576bf 100644 Binary files a/metar_taf_parser/locale/de/LC_MESSAGES/messages.mo and b/metar_taf_parser/locale/de/LC_MESSAGES/messages.mo differ diff --git a/metar_taf_parser/locale/en/LC_MESSAGES/messages.mo b/metar_taf_parser/locale/en/LC_MESSAGES/messages.mo index b5c0c0e..f700673 100644 Binary files a/metar_taf_parser/locale/en/LC_MESSAGES/messages.mo and b/metar_taf_parser/locale/en/LC_MESSAGES/messages.mo differ diff --git a/metar_taf_parser/locale/en/LC_MESSAGES/messages.po b/metar_taf_parser/locale/en/LC_MESSAGES/messages.po index 44f7cf4..09d824c 100644 --- a/metar_taf_parser/locale/en/LC_MESSAGES/messages.po +++ b/metar_taf_parser/locale/en/LC_MESSAGES/messages.po @@ -258,6 +258,10 @@ msgstr "The airport was not found for this message." msgid "ErrorCode.InvalidMessage" msgstr "The entered message is invalid." +#: +msgid "ErrorCode.IncompleteRunwayInformation" +msgstr "The runway information is incomplete and cannot be parsed." + #: msgid "Flag.AMD" msgstr "amended TAF" diff --git a/metar_taf_parser/locale/es/LC_MESSAGES/messages.mo b/metar_taf_parser/locale/es/LC_MESSAGES/messages.mo index a5b5075..91c39a1 100644 Binary files a/metar_taf_parser/locale/es/LC_MESSAGES/messages.mo and b/metar_taf_parser/locale/es/LC_MESSAGES/messages.mo differ diff --git a/metar_taf_parser/locale/es/LC_MESSAGES/messages.po b/metar_taf_parser/locale/es/LC_MESSAGES/messages.po index 315a37b..ff2af4c 100644 --- a/metar_taf_parser/locale/es/LC_MESSAGES/messages.po +++ b/metar_taf_parser/locale/es/LC_MESSAGES/messages.po @@ -16,7 +16,7 @@ msgstr "cubierto" #: msgid "CloudQuantity.SKC" -msgstr "cielo claro" +msgstr "cielo despejado" #: msgid "CloudType.AC" @@ -66,6 +66,10 @@ msgstr "Torrecumulus" msgid "DepositBrakingCapacity.//" msgstr "no reportado" +#: +msgid "DepositCoverage.NOT_REPORTED" +msgstr "no reportado" + #: msgid "DepositCoverage.LESS_10" msgstr "menos de 10%" @@ -91,27 +95,27 @@ msgid "DepositThickness.00" msgstr "menos de 1 mm" #: -msgid "DepositThickness.THICKNESS_10" +msgid "DepositThickness.92" msgstr "10 cm" #: -msgid "DepositThickness.THICKNESS_15" +msgid "DepositThickness.93" msgstr "15 cm" #: -msgid "DepositThickness.THICKNESS_20" +msgid "DepositThickness.94" msgstr "20 cm" #: -msgid "DepositThickness.THICKNESS_25" +msgid "DepositThickness.95" msgstr "25 cm" #: -msgid "DepositThickness.THICKNESS_30" +msgid "DepositThickness.96" msgstr "30 cm" #: -msgid "DepositThickness.THICKNESS_35" +msgid "DepositThickness.97" msgstr "35 cm" #: @@ -122,6 +126,10 @@ msgstr "40 cm o más" msgid "DepositThickness.99" msgstr "cerrado" +#: +msgid "DepositThickness.default" +msgstr "{0} mm" + #: msgid "DepositType.NOT_REPORTED" msgstr "no reportado" @@ -166,6 +174,66 @@ msgstr "huellas o cumbres congeladas" msgid "DepositType.SLUSH" msgstr "nieve derretida" +#: +msgid "Descriptive.PR" +msgstr "parcial" + +#: +msgid "Descriptive.TS" +msgstr "tormenta" + +#: +msgid "ErrorCode.InvalidMessage" +msgstr "El mensaje ingresado es inválido." + +#: +msgid "Flag.AMD" +msgstr "TAF modificado" + +#: +msgid "Flag.AUTO" +msgstr "METAR automatizado" + +#: +msgid "Flag.CNL" +msgstr "TAF cancelado" + +#: +msgid "Indicator.M" +msgstr "menos que" + +#: +msgid "Indicator.P" +msgstr "más que" + +#: +msgid "Intensity.RE" +msgstr "reciente" + +#: +msgid "Phenomenon.DS" +msgstr "tormenta de polvo" + +#: +msgid "Phenomenon.FG" +msgstr "niebla" + +#: +msgid "Phenomenon.FU" +msgstr "humo" + +#: +msgid "Phenomenon.RA" +msgstr "lluvia" + +#: +msgid "Phenomenon.SA" +msgstr "arena" + +#: +msgid "Phenomenon.SN" +msgstr "nieve" + #: msgid "Phenomenon.SS" msgstr "tormenta de arena" @@ -254,3 +322,151 @@ msgstr "pronóstico" msgid "Remark.FUNNELCLOUD" msgstr "nube embudo" +#: +msgid "Remark.NXT" +msgstr "siguiente" + +#: +msgid "Remark.TORNADO" +msgstr "tornado" + +#: +msgid "MetarFacade.InvalidIcao" +msgstr "El código Icao no es válido." + +#: +msgid "Converter.E" +msgstr "Este" + +#: +msgid "Converter.N" +msgstr "Norte" + +#: +msgid "Converter.NE" +msgstr "Noreste" + +#: +msgid "Converter.NW" +msgstr "Noroeste" + +#: +msgid "Converter.S" +msgstr "Sur" + +#: +msgid "Converter.SE" +msgstr "Sureste" + +#: +msgid "Converter.VRB" +msgstr "Variable" + +#: +msgid "Converter.W" +msgstr "Oeste" + +#: +msgid "WeatherChangeType.INTER" +msgstr "Intermitente" + +#: +msgid "WeatherChangeType.TEMPO" +msgstr "Temporal" + +#: +msgid "WeatherChangeType.PROB" +msgstr "Probabilidad" + +#: +msgid "TimeIndicator.FM" +msgstr "Desde" + +#: +msgid "TimeIndicator.TL" +msgstr "hasta" + +#: +msgid "ToString.airport" +msgstr "aeropuerto" + +#: +msgid "ToString.clouds" +msgstr "nubes" + +#: +msgid "ToString.day.month" +msgstr "día del mes" + +#: +msgid "ToString.day.hour" +msgstr "hora del día" + +#: +msgid "ToString.height.feet" +msgstr "altura (cm)" + +#: +msgid "ToString.height.meter" +msgstr "altura (m)" + +#: +msgid "ToString.intensity" +msgstr "intensidad" + +#: +msgid "ToString.indicator" +msgstr "indicador" + +#: +msgid "ToString.message" +msgstr "mensaje original" + +#: +msgid "ToString.name" +msgstr "nombre" + +#: +msgid "ToString.phenomenons" +msgstr "fenómenos" + +#: +msgid "ToString.probability" +msgstr "probabilidad" + +#: +msgid "ToString.quantity" +msgstr "cantidad" + +#: +msgid "ToString.report.time" +msgstr "hora del informe" + +#: +msgid "ToString.temperature" +msgstr "temperatura (°C)" + +#: +msgid "ToString.temperature.max" +msgstr "temperatura máxima (°C)" + +#: +msgid "ToString.temperature.min" +msgstr "temperatura mínima (°C)" + +#: +msgid "ToString.type" +msgstr "tipo" + +#: +msgid "ToString.wind.direction" +msgstr "dirección" + +#: +msgid "ToString.wind.direction.degrees" +msgstr "dirección (grados)" + +#: +msgid "TurbulenceIntensity.X" +msgstr "Turbulencia extrema" + diff --git a/metar_taf_parser/locale/fr/LC_MESSAGES/messages.mo b/metar_taf_parser/locale/fr/LC_MESSAGES/messages.mo index e3524c2..685d892 100644 Binary files a/metar_taf_parser/locale/fr/LC_MESSAGES/messages.mo and b/metar_taf_parser/locale/fr/LC_MESSAGES/messages.mo differ diff --git a/metar_taf_parser/locale/fr/LC_MESSAGES/messages.po b/metar_taf_parser/locale/fr/LC_MESSAGES/messages.po index 07aa940..800ee8d 100644 --- a/metar_taf_parser/locale/fr/LC_MESSAGES/messages.po +++ b/metar_taf_parser/locale/fr/LC_MESSAGES/messages.po @@ -30,14 +30,6 @@ msgstr "nuages épars" msgid "CloudQuantity.SKC" msgstr "pas de nuage" -#: -msgid "CloudType.AC" -msgstr "Altocumulus" - -#: -msgid "CloudType.AS" -msgstr "Altostratus" - #: msgid "CloudType.CB" msgstr "Cumunolinbus" @@ -46,30 +38,6 @@ msgstr "Cumunolinbus" msgid "CloudType.CC" msgstr "Cirrocumulus" -#: -msgid "CloudType.CI" -msgstr "Cirrus" - -#: -msgid "CloudType.CS" -msgstr "Cirrostratus" - -#: -msgid "CloudType.CU" -msgstr "Cumulus" - -#: -msgid "CloudType.NS" -msgstr "Nimbostratus" - -#: -msgid "CloudType.SC" -msgstr "Stratocumulus" - -#: -msgid "CloudType.ST" -msgstr "Stratus" - #: msgid "CloudType.TCU" msgstr "Cumulus bourgeonnant" @@ -102,10 +70,6 @@ msgstr "bonne" msgid "DepositBrakingCapacity.99" msgstr "valeurs non fiables" -#: -msgid "DepositBrakingCapacity.default" -msgstr "friction coefficient of {0}" - #: msgid "DepositCoverage.NOT_REPORTED" msgstr "non reportée" @@ -134,30 +98,6 @@ msgstr "non reportée" msgid "DepositThickness.00" msgstr "moins de 1 mm" -#: -msgid "DepositThickness.92" -msgstr "10 cm" - -#: -msgid "DepositThickness.93" -msgstr "15 cm" - -#: -msgid "DepositThickness.94" -msgstr "20 cm" - -#: -msgid "DepositThickness.95" -msgstr "25 cm" - -#: -msgid "DepositThickness.96" -msgstr "30 cm" - -#: -msgid "DepositThickness.97" -msgstr "35 cm" - #: msgid "DepositThickness.98" msgstr "40 cm ou plus" @@ -166,10 +106,6 @@ msgstr "40 cm ou plus" msgid "DepositThickness.99" msgstr "fermée" -#: -msgid "DepositThickness.default" -msgstr "{0} mm" - #: msgid "DepositType.NOT_REPORTED" msgstr "non reportée" @@ -258,6 +194,10 @@ msgstr "L'aéroport n'a pas été trouvé pour ce message." msgid "ErrorCode.InvalidMessage" msgstr "Le message entré est invalide." +#: +msgid "ErrorCode.IncompleteRunwayInformation" +msgstr "Les informations sur la piste sont incomplètes et ne peuvent pas être analysées." + #: msgid "Flag.AMD" msgstr "TAF modifié" @@ -394,10 +334,6 @@ msgstr "granules de glace" msgid "Phenomenon.PO" msgstr "tourbillon de poussières sable" -#: -msgid "Phenomenon.PY" -msgstr "spray" - #: msgid "Phenomenon.RA" msgstr "pluie" @@ -536,7 +472,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 +508,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 +572,7 @@ msgstr "{0} grésil" #: msgid "Remark.Sunshine.Duration" -msgstr "{0} minutes d'ensoleillement" +msgstr "{0} minutes d''ensoleillement" #: msgid "Remark.Surface.Visibility" @@ -682,10 +618,6 @@ msgstr "couche de nuages variant entre {0} et {1}" msgid "Remark.Variable.Sky.Condition.Height" msgstr "couche de nuages à {0} pieds variant entre {1} et {2}" -#: -msgid "Remark.VIRGA" -msgstr "virga" - #: msgid "Remark.Virga.Direction" msgstr "virga au {0} de la station" @@ -696,7 +628,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 +636,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" @@ -774,10 +706,6 @@ msgstr "Sud Ouest" msgid "Converter.U" msgstr "accroissement" -#: -msgid "Converter.VRB" -msgstr "Variable" - #: msgid "Converter.W" msgstr "Ouest" @@ -834,18 +762,10 @@ msgstr "altimètre (hPa)" msgid "ToString.amendment" msgstr "amendement" -#: -msgid "ToString.auto" -msgstr "auto" - #: msgid "ToString.baseHeight" msgstr "Base de la couche en pied" -#: -msgid "ToString.cavok" -msgstr "cavok" - #: msgid "ToString.clouds" msgstr "nuages" @@ -922,10 +842,6 @@ msgstr "message original" msgid "ToString.name" msgstr "nom" -#: -msgid "ToString.nosig" -msgstr "nosig" - #: msgid "ToString.phenomenons" msgstr "phénomènes" @@ -982,10 +898,6 @@ msgstr "tendance" msgid "ToString.trends" msgstr "tendances" -#: -msgid "ToString.type" -msgstr "type" - #: msgid "ToString.visibility.main" msgstr "visibilité principale" @@ -1010,10 +922,6 @@ msgstr "visibilité verticale (pieds)" msgid "ToString.weather.conditions" msgstr "conditions météorologique" -#: -msgid "ToString.wind.direction" -msgstr "direction" - #: msgid "ToString.wind.direction.degrees" msgstr "direction (degrés)" diff --git a/metar_taf_parser/locale/it/LC_MESSAGES/messages.mo b/metar_taf_parser/locale/it/LC_MESSAGES/messages.mo index 6f8cae0..bcf373f 100644 Binary files a/metar_taf_parser/locale/it/LC_MESSAGES/messages.mo and b/metar_taf_parser/locale/it/LC_MESSAGES/messages.mo differ diff --git a/metar_taf_parser/locale/it/LC_MESSAGES/messages.po b/metar_taf_parser/locale/it/LC_MESSAGES/messages.po index 2656155..515cdd1 100644 --- a/metar_taf_parser/locale/it/LC_MESSAGES/messages.po +++ b/metar_taf_parser/locale/it/LC_MESSAGES/messages.po @@ -102,6 +102,10 @@ msgstr "buono" msgid "DepositBrakingCapacity.99" msgstr "cifre inaffidabili" +#: +msgid "DepositBrakingCapacity.default" +msgstr "coefficiente di attrito di {0}" + #: msgid "DepositCoverage.NOT_REPORTED" msgstr "non riportato" @@ -131,27 +135,27 @@ msgid "DepositThickness.00" msgstr "meno di 1 mm" #: -msgid "DepositThickness.THICKNESS_10" +msgid "DepositThickness.92" msgstr "10 cm" #: -msgid "DepositThickness.THICKNESS_15" +msgid "DepositThickness.93" msgstr "15 cm" #: -msgid "DepositThickness.THICKNESS_20" +msgid "DepositThickness.94" msgstr "20 cm" #: -msgid "DepositThickness.THICKNESS_25" +msgid "DepositThickness.95" msgstr "25 cm" #: -msgid "DepositThickness.THICKNESS_30" +msgid "DepositThickness.96" msgstr "30 cm" #: -msgid "DepositThickness.THICKNESS_35" +msgid "DepositThickness.97" msgstr "35 cm" #: @@ -162,6 +166,10 @@ msgstr "40 cm" msgid "DepositThickness.99" msgstr "chiusa" +#: +msgid "DepositThickness.default" +msgstr "{0} mm" + #: msgid "DepositType.NOT_REPORTED" msgstr "non riportato" @@ -202,6 +210,10 @@ msgstr "neve compatta" msgid "DepositType.FROZEN_RIDGES" msgstr "solchi o creste congelate" +#: +msgid "DepositType.SLUSH" +msgstr "fanghiglia" + #: msgid "Descriptive.BC" msgstr "banchi di nebbia" @@ -246,6 +258,66 @@ msgstr "L’aeroporto non è stato trovato in questa notifica" msgid "ErrorCode.InvalidMessage" msgstr "Il messaggio non è valido" +#: +msgid "Flag.AMD" +msgstr "TAF modificato" + +#: +msgid "Flag.AUTO" +msgstr "METAR automatizzato" + +#: +msgid "Flag.CNL" +msgstr "TAF cancellato" + +#: +msgid "Flag.COR" +msgstr "METAR/TAF corretto" + +#: +msgid "Flag.NIL" +msgstr "nessun dato" + +#: +msgid "IcingIntensity.0" +msgstr "Trace di ghiaccio o nessuno" + +#: +msgid "IcingIntensity.1" +msgstr "Ghiaccio misto leggero" + +#: +msgid "IcingIntensity.2" +msgstr "Ghiacciamento leggero in nuvola" + +#: +msgid "IcingIntensity.3" +msgstr "Ghiacciamento chiaro leggero in precipitazione" + +#: +msgid "IcingIntensity.4" +msgstr "Ghiaccio misto moderato" + +#: +msgid "IcingIntensity.5" +msgstr "Ghiacciamento moderato in nuvola" + +#: +msgid "IcingIntensity.6" +msgstr "Ghiacciamento chiaro moderato in precipitazione" + +#: +msgid "IcingIntensity.7" +msgstr "Ghiaccio misto grave" + +#: +msgid "IcingIntensity.8" +msgstr "Ghiacciamento grave in nuvola" + +#: +msgid "IcingIntensity.9" +msgstr "Grave Ghiacciamento chiaro in precipitazione" + #: msgid "Indicator.M" msgstr "minore di" @@ -366,6 +438,46 @@ msgstr "stazioni automatizzate senza discriminatore di precipitazione" msgid "Remark.AO2" msgstr "stazione automatizzata con discriminatore di precipitazione" +#: +msgid "Remark.ALQDS" +msgstr "tutti i quadranti" + +#: +msgid "Remark.Barometer.0" +msgstr "Incrementa, poi diminuisci" + +#: +msgid "Remark.Barometer.1" +msgstr "Incrementa, poi stabile, o aumenta poi aumenta più lentamente" + +#: +msgid "Remark.Barometer.2" +msgstr "aumento costante o instabile" + +#: +msgid "Remark.Barometer.3" +msgstr "Diminuire o stabile, quindi aumentare; o aumentare poi aumentare più rapidamente" + +#: +msgid "Remark.Barometer.4" +msgstr "Costante" + +#: +msgid "Remark.Barometer.5" +msgstr "Diminuire, poi aumentare" + +#: +msgid "Remark.Barometer.6" +msgstr "Diminuire quindi costante; o diminuire, quindi diminuire più lentamente" + +#: +msgid "Remark.Barometer.7" +msgstr "Riduzione costante o instabile" + +#: +msgid "Remark.Barometer.8" +msgstr "Stazionario o aumenta, quindi diminuisce; o diminuire poi diminuisce più rapidamente" + #: msgid "Remark.BASED" msgstr "basato" @@ -378,6 +490,10 @@ msgstr "base delle nubi tra {0} e {1} piedi" msgid "Remark.Ceiling.Second.Location" msgstr "base delle nubi di {0} piedi misurato da un secondo sensore situato a {1}" +#: +msgid "Remark.DSNT" +msgstr "distante" + #: msgid "Remark.FCST" msgstr "previsione" @@ -394,6 +510,30 @@ msgstr "chicchi di grandine più grandi con un diametro di {0} pollici" msgid "Remark.Hail.LesserThan" msgstr "chicchi di grandine più grandi con un diametro inferiore di {0} pollici" +#: +msgid "Remark.Hourly.Maximum.Temperature" +msgstr "Temperatura massima ogni 6 ore di {0}°C" + +#: +msgid "Remark.Hourly.Maximum.Minimum.Temperature" +msgstr "Temperatura massima ogni 24 ore di {0}°C e temperatura minima ogni 24 ore di {1}°C" + +#: +msgid "Remark.Hourly.Minimum.Temperature" +msgstr "Temperatura minima su 6 ore di {0}°C" + +#: +msgid "Remark.Hourly.Temperature" +msgstr "temperatura oraria di {0}°C" + +#: +msgid "Remark.Hourly.Temperature.Dew.Point" +msgstr "temperatura oraria di {0}°C e punto di rugiada di {1}°C" + +#: +msgid "Remark.Ice.Accretion.Amount" +msgstr "{0}/100 di pollice di accrescimento di ghiaccio nelle ultime {1} ore" + #: msgid "Remark.HVY" msgstr "pesante" @@ -402,6 +542,10 @@ msgstr "pesante" msgid "Remark.LGT" msgstr "leggero" +#: +msgid "Remark.LTG" +msgstr "fulmine" + #: msgid "Remark.MOD" msgstr "moderato" @@ -422,10 +566,34 @@ msgstr "prossimo" msgid "Remark.PeakWind" msgstr "picco di vento di {1} nodi da {0} gradi a {2}:{3}" +#: +msgid "Remark.Precipitation.Amount.Hourly" +msgstr "Nell''ultima ora è caduto {0}/100 di pollice di precipitazioni" + +#: +msgid "Remark.Precipitation.Amount.3.6" +msgstr "{1} pollici di precipitazioni sono caduti nelle ultime {0} ore" + +#: +msgid "Remark.Precipitation.Amount.24" +msgstr "{0} pollici di precipitazioni sono caduti nelle ultime 24 ore" + +#: +msgid "Remark.Precipitation.Beg" +msgstr "{0} {1} inizia alle {2}:{3}" + #: msgid "Remark.Precipitation.Beg.End" msgstr "{0} {1} inizia a {2}:{3} e termina a {4}:{5}" +#: +msgid "Remark.Precipitation.End" +msgstr "{0} {1} termina alle {2}:{3}" + +#: +msgid "Remark.Pressure.Tendency" +msgstr "di {0} HPa nelle ultime 3 ore" + #: msgid "Remark.PRESFR" msgstr "pressione in caduta rapidamente " @@ -450,6 +618,10 @@ msgstr "visibilità di {1} SM in direzione {0}" msgid "Remark.SLPNO" msgstr "pressione a livello del mare non disponibile" +#: +msgid "Remark.Snow.Depth" +msgstr "altezza della neve di {0} pollici" + #: msgid "Remark.Snow.Increasing.Rapidly" msgstr "aumento dell’altezza della neve di {0} pollici nell’ultima ora con un’altezza totale al suolo di {1} pollici" @@ -458,6 +630,10 @@ msgstr "aumento dell’altezza della neve di {0} pollici nell’ultima ora con u msgid "Remark.Snow.Pellets" msgstr "{0} neve tonda " +#: +msgid "Remark.Sunshine.Duration" +msgstr "{0} minuti di sole" + #: msgid "Remark.Surface.Visibility" msgstr "visibilità in superficie di {0} Statute Miles" @@ -514,6 +690,10 @@ msgstr "virga {0} dalla stazione" msgid "Remark.WATERSPOUT" msgstr "tromba marina" +#: +msgid "Remark.Water.Equivalent.Snow.Ground" +msgstr "equivalente in acqua di {0} pollici di neve" + #: msgid "Remark.WindShift" msgstr "spostamento del vento a {0}:{1}" @@ -614,6 +794,10 @@ msgstr "Da" msgid "WeatherChangeType.BECMG" msgstr "Diventa" +#: +msgid "WeatherChangeType.INTER" +msgstr "Intermittente" + #: msgid "WeatherChangeType.TEMPO" msgstr "Temporanea" @@ -650,6 +834,10 @@ msgstr "emendamento" msgid "ToString.auto" msgstr "auto" +#: +msgid "ToString.baseHeight" +msgstr "strato di base in piedi" + #: msgid "ToString.cavok" msgstr "cavok" @@ -682,6 +870,10 @@ msgstr "spessore" msgid "ToString.deposit.type" msgstr "tipo di deposito" +#: +msgid "ToString.depth" +msgstr "profondità dello strato nei piedi" + #: msgid "ToString.descriptive" msgstr "descrittivo" @@ -698,6 +890,10 @@ msgstr "ultimo giorno del mese" msgid "ToString.end.hour.day" msgstr "ultima ora del giorno" +#: +msgid "ToString.flags" +msgstr "bandiere" + #: msgid "ToString.height.feet" msgstr "altezza (ft)" @@ -838,3 +1034,47 @@ msgstr "velocità" msgid "ToString.wind.unit" msgstr "unità" +#: +msgid "TurbulenceIntensity.0" +msgstr "Nessuno" + +#: +msgid "TurbulenceIntensity.1" +msgstr "Turbolenza leggera" + +#: +msgid "TurbulenceIntensity.2" +msgstr "Moderata turbolenza con aria limpida, occasionale" + +#: +msgid "TurbulenceIntensity.3" +msgstr "Moderata turbolenza con aria limpida, frequente" + +#: +msgid "TurbulenceIntensity.4" +msgstr "Moderata turbolenza in nubi, occasionale" + +#: +msgid "TurbulenceIntensity.5" +msgstr "Moderata turbolenza in nubi, frequente" + +#: +msgid "TurbulenceIntensity.6" +msgstr "Forte turbolenza in aria limpida, occasionale" + +#: +msgid "TurbulenceIntensity.7" +msgstr "Forte turbolenza in aria limpida, frequente" + +#: +msgid "TurbulenceIntensity.8" +msgstr "Forte turbolenza in nubi, occasionale" + +#: +msgid "TurbulenceIntensity.9" +msgstr "Forte turbolenza in nubi, frequente" + +#: +msgid "TurbulenceIntensity.X" +msgstr "Estrema turbolenza" + diff --git a/metar_taf_parser/locale/messages.pot b/metar_taf_parser/locale/messages.pot index 44f7cf4..09d824c 100644 --- a/metar_taf_parser/locale/messages.pot +++ b/metar_taf_parser/locale/messages.pot @@ -258,6 +258,10 @@ msgstr "The airport was not found for this message." msgid "ErrorCode.InvalidMessage" msgstr "The entered message is invalid." +#: +msgid "ErrorCode.IncompleteRunwayInformation" +msgstr "The runway information is incomplete and cannot be parsed." + #: msgid "Flag.AMD" msgstr "amended TAF" diff --git a/metar_taf_parser/locale/pl/LC_MESSAGES/messages.mo b/metar_taf_parser/locale/pl/LC_MESSAGES/messages.mo index 1f1717f..6273449 100644 Binary files a/metar_taf_parser/locale/pl/LC_MESSAGES/messages.mo and b/metar_taf_parser/locale/pl/LC_MESSAGES/messages.mo differ diff --git a/metar_taf_parser/locale/pl/LC_MESSAGES/messages.po b/metar_taf_parser/locale/pl/LC_MESSAGES/messages.po index 600ede2..88e65ad 100644 --- a/metar_taf_parser/locale/pl/LC_MESSAGES/messages.po +++ b/metar_taf_parser/locale/pl/LC_MESSAGES/messages.po @@ -5,7 +5,7 @@ msgstr "" "Content-Transfer-Encoding: 8bit" "X-Generator: prop2po" "Project-Id-Version: metar_taf_parser" -"Language: pl_PL" +"Language: pl" #: msgid "CloudQuantity.BKN" msgstr "Od 5/8 do 7/8" diff --git a/metar_taf_parser/locale/ru-RU/LC_MESSAGES/messages.mo b/metar_taf_parser/locale/ru-RU/LC_MESSAGES/messages.mo index 9910d10..6bbcc9b 100644 Binary files a/metar_taf_parser/locale/ru-RU/LC_MESSAGES/messages.mo and b/metar_taf_parser/locale/ru-RU/LC_MESSAGES/messages.mo differ diff --git a/metar_taf_parser/locale/ru-RU/LC_MESSAGES/messages.po b/metar_taf_parser/locale/ru-RU/LC_MESSAGES/messages.po index 5943c3c..e71a55d 100644 --- a/metar_taf_parser/locale/ru-RU/LC_MESSAGES/messages.po +++ b/metar_taf_parser/locale/ru-RU/LC_MESSAGES/messages.po @@ -5,7 +5,7 @@ msgstr "" "Content-Transfer-Encoding: 8bit" "X-Generator: prop2po" "Project-Id-Version: metar_taf_parser" -"Language: ru_RU" +"Language: ru-RU" #: msgid "CloudQuantity.BKN" msgstr "разорванная" @@ -258,6 +258,10 @@ msgstr "Аэропорт не найден для этого сообщения. msgid "ErrorCode.InvalidMessage" msgstr "Введенное сообщение неверное." +#: +msgid "ErrorCode.IncompleteRunwayInformation" +msgstr "Информация о взлетно-посадочной полосе является неполной и не может быть обработана." + #: msgid "Flag.AMD" msgstr "Измененный TAF" diff --git a/metar_taf_parser/locale/tr/LC_MESSAGES/messages.mo b/metar_taf_parser/locale/tr/LC_MESSAGES/messages.mo index 446e462..89b6e73 100644 Binary files a/metar_taf_parser/locale/tr/LC_MESSAGES/messages.mo and b/metar_taf_parser/locale/tr/LC_MESSAGES/messages.mo differ diff --git a/metar_taf_parser/locale/tr/LC_MESSAGES/messages.po b/metar_taf_parser/locale/tr/LC_MESSAGES/messages.po index 3bc70f6..6006118 100644 --- a/metar_taf_parser/locale/tr/LC_MESSAGES/messages.po +++ b/metar_taf_parser/locale/tr/LC_MESSAGES/messages.po @@ -5,7 +5,7 @@ msgstr "" "Content-Transfer-Encoding: 8bit" "X-Generator: prop2po" "Project-Id-Version: metar_taf_parser" -"Language: tr_TR" +"Language: tr" #: msgid "CloudQuantity.BKN" msgstr "parçalı çok bulutlu" @@ -130,30 +130,6 @@ msgstr "rapor edilmedi" msgid "DepositThickness.00" msgstr "1 mm'den daha az" -#: -msgid "DepositThickness.THICKNESS_10" -msgstr "10 cm" - -#: -msgid "DepositThickness.THICKNESS_15" -msgstr "15 cm" - -#: -msgid "DepositThickness.THICKNESS_20" -msgstr "20 cm" - -#: -msgid "DepositThickness.THICKNESS_25" -msgstr "25 cm" - -#: -msgid "DepositThickness.THICKNESS_30" -msgstr "30 cm" - -#: -msgid "DepositThickness.THICKNESS_35" -msgstr "35 cm" - #: msgid "DepositThickness.98" msgstr "40 cm veya daha fazla" diff --git a/metar_taf_parser/locale/zh-CN/LC_MESSAGES/messages.mo b/metar_taf_parser/locale/zh-CN/LC_MESSAGES/messages.mo index 43d253d..c730994 100644 Binary files a/metar_taf_parser/locale/zh-CN/LC_MESSAGES/messages.mo and b/metar_taf_parser/locale/zh-CN/LC_MESSAGES/messages.mo differ diff --git a/metar_taf_parser/locale/zh-CN/LC_MESSAGES/messages.po b/metar_taf_parser/locale/zh-CN/LC_MESSAGES/messages.po index b26b082..a2cc2ac 100644 --- a/metar_taf_parser/locale/zh-CN/LC_MESSAGES/messages.po +++ b/metar_taf_parser/locale/zh-CN/LC_MESSAGES/messages.po @@ -5,7 +5,7 @@ msgstr "" "Content-Transfer-Encoding: 8bit" "X-Generator: prop2po" "Project-Id-Version: metar_taf_parser" -"Language: zh_CN" +"Language: zn-CN" #: msgid "CloudQuantity.BKN" msgstr "5-7分云" @@ -91,7 +91,7 @@ msgid "DepositBrakingCapacity.93" msgstr "中" #: -msgid "DepositBrakingCapacity.MEDIUM_GOOD" +msgid "DepositBrakingCapacity.94" msgstr "良好" #: @@ -102,6 +102,10 @@ msgstr "好" msgid "DepositBrakingCapacity.99" msgstr "数字不可靠" +#: +msgid "DepositBrakingCapacity.default" +msgstr "摩擦系数为 {0}" + #: msgid "DepositCoverage.NOT_REPORTED" msgstr "未报告" @@ -131,27 +135,27 @@ msgid "DepositThickness.00" msgstr "小于 1 毫米" #: -msgid "DepositThickness.THICKNESS_10" +msgid "DepositThickness.92" msgstr "10 厘米" #: -msgid "DepositThickness.THICKNESS_15" +msgid "DepositThickness.93" msgstr "15 厘米" #: -msgid "DepositThickness.THICKNESS_20" +msgid "DepositThickness.94" msgstr "20 厘米" #: -msgid "DepositThickness.THICKNESS_25" +msgid "DepositThickness.95" msgstr "25 厘米" #: -msgid "DepositThickness.THICKNESS_30" +msgid "DepositThickness.96" msgstr "30 厘米" #: -msgid "DepositThickness.THICKNESS_35" +msgid "DepositThickness.97" msgstr "35 厘米" #: @@ -162,6 +166,10 @@ msgstr "40厘米或以上" msgid "DepositThickness.99" msgstr "已关闭" +#: +msgid "DepositThickness.default" +msgstr "{0} 毫米" + #: msgid "DepositType.NOT_REPORTED" msgstr "未报告" @@ -250,6 +258,42 @@ msgstr "找不到此消息的机场。" msgid "ErrorCode.InvalidMessage" msgstr "输入的消息无效。" +#: +msgid "Flag.AMD" +msgstr "修正后的TAF" + +#: +msgid "Flag.AUTO" +msgstr "自动生成的METAR" + +#: +msgid "Flag.CNL" +msgstr "已取消的TAF" + +#: +msgid "Flag.COR" +msgstr "已更正的METAR/TAF" + +#: +msgid "Flag.NIL" +msgstr "暂无数据" + +#: +msgid "IcingIntensity.0" +msgstr "微量结冰" + +#: +msgid "IcingIntensity.1" +msgstr "轻度混合结冰" + +#: +msgid "IcingIntensity.2" +msgstr "云中轻度霜冻结冰" + +#: +msgid "IcingIntensity.7" +msgstr "重度混合结冰" + #: msgid "Indicator.M" msgstr "小于" @@ -498,6 +542,18 @@ msgstr "下一个" msgid "Remark.PeakWind" msgstr "在 {2}:{3} 有位于 {0} 度,风速 {1} 节的峰值风" +#: +msgid "Remark.PRESFR" +msgstr "气压骤降" + +#: +msgid "Remark.PRESRR" +msgstr "气压骤升" + +#: +msgid "Remark.Sea.Level.Pressure" +msgstr "海平面气压{0} 百帕" + #: msgid "Remark.TORNADO" msgstr "龙卷风" @@ -698,6 +754,10 @@ msgstr "当月的结束日" msgid "ToString.end.hour.day" msgstr "当日的结束小时" +#: +msgid "ToString.flags" +msgstr "旗子" + #: msgid "ToString.height.feet" msgstr "高度(英尺)" @@ -838,3 +898,19 @@ msgstr "速度" msgid "ToString.wind.unit" msgstr "单位" +#: +msgid "TurbulenceIntensity.0" +msgstr "无" + +#: +msgid "TurbulenceIntensity.1" +msgstr "轻度乱流" + +#: +msgid "TurbulenceIntensity.8" +msgstr "云中偶发重度颠簸" + +#: +msgid "TurbulenceIntensity.X" +msgstr "极端乱流" + diff --git a/metar_taf_parser/tests/command/test_metar.py b/metar_taf_parser/tests/command/test_metar.py index 9ca6c05..126fdf2 100644 --- a/metar_taf_parser/tests/command/test_metar.py +++ b/metar_taf_parser/tests/command/test_metar.py @@ -1,6 +1,7 @@ import unittest from metar_taf_parser.command.metar import RunwayCommand, CommandSupplier +from metar_taf_parser.commons.exception import ParseError from metar_taf_parser.model.enum import DepositType, DepositCoverage from metar_taf_parser.model.model import Metar from metar_taf_parser.commons.i18n import _ @@ -108,6 +109,14 @@ def test_parse_runway_with_greater_than_indicator(self): self.assertEqual('P', metar.runways_info[0].indicator) self.assertEqual(600, metar.runways_info[0].min_range) + def test_parse_runway_missing_info(self): + metar = Metar() + with self.assertRaises(ParseError) as context: + RunwayCommand().execute(metar, "R16///////") + + error = context.exception + self.assertEqual(_("ErrorCode.IncompleteRunwayInformation"), error.message()) + def test_command_supplier(self): command_supplier = CommandSupplier()