Exemple #1
0
def other(wxcodes: [str]) -> str:
    """
    Format wx codes into a spoken word string
    """
    ret = []
    for code in wxcodes:
        item = translate.wxcode(code)
        if item.startswith('Vicinity'):
            item = item.lstrip('Vicinity ') + ' in the Vicinity'
        ret.append(item)
    return '. '.join(ret)
Exemple #2
0
def other(wxcodes: [str]) -> str:
    """
    Format wx codes into a spoken word string
    """
    ret = []
    for code in wxcodes:
        item = translate.wxcode(code)
        if item.startswith("Vicinity"):
            item = item.lstrip("Vicinity ") + " in the Vicinity"
        ret.append(item)
    return ". ".join(ret)
Exemple #3
0
def other(wxcodes: [str]) -> str:
    """
    Format wx codes into a spoken word string
    """
    ret = []
    for item in wxcodes:
        item = translate.wxcode(item)
        if item.startswith('Vicinity'):
            item = item.lstrip('Vicinity ') + ' in the Vicinity'
        ret.append(item)
    return '. '.join(ret)
Exemple #4
0
 def test_wxcode(self):
     """
     Tests expenading weather codes or ignoring them
     """
     for code, translation in (
         ('', ''),
         ('R03/03002V03', 'R03/03002V03'),
         ('+RATS', 'Heavy Rain Thunderstorm'),
         ('VCFC', 'Vicinity Funnel Cloud'),
         ('-GR', 'Light Hail'),
         ('FZFG', 'Freezing Fog'),
         ('BCBLSN', 'Patchy Blowing Snow'),
     ):
         self.assertEqual(translate.wxcode(code), translation)
Exemple #5
0
 def test_wxcode(self):
     """
     Tests expanding weather codes or ignoring them
     """
     for code, translation in (
         ("", ""),
         ("R03/03002V03", "R03/03002V03"),
         ("+RATS", "Heavy Rain Thunderstorm"),
         ("VCFC", "Vicinity Funnel Cloud"),
         ("-GR", "Light Hail"),
         ("FZFG", "Freezing Fog"),
         ("BCBLSN", "Patchy Blowing Snow"),
     ):
         self.assertEqual(translate.wxcode(code), translation)
 def test_wxcode(self):
     """
     Tests expenading weather codes or ignoring them
     """
     for code, translation in (
         ('', ''),
         ('R03/03002V03', 'R03/03002V03'),
         ('+RATS', 'Heavy Rain Thunderstorm'),
         ('VCFC', 'Vicinity Funnel Cloud'),
         ('-GR', 'Light Hail'),
         ('FZFG', 'Freezing Fog'),
         ('BCBLSN', 'Patchy Blowing Snow'),
     ):
         self.assertEqual(translate.wxcode(code), translation)