]> ToastFreeware Gitweb - philipp/winterrodeln/wrpylib.git/commitdiff
Whitespace changes.
authorPhilipp Spitzer <philipp@spitzer.priv.at>
Mon, 11 Jul 2022 20:03:40 +0000 (22:03 +0200)
committerPhilipp Spitzer <philipp@spitzer.priv.at>
Mon, 11 Jul 2022 20:03:40 +0000 (22:03 +0200)
wrpylib/wrmwmarkup.py

index 547c2e1f6126f633b7fac91a283db44b6f057a26..49fb7971fe1320b91fa5d6d828303d3349b8ca06 100644 (file)
@@ -208,7 +208,7 @@ WRMAP_LINE_TYPES = ['rodelbahn', 'gehweg', 'alternative', 'lift', 'anfahrt', 'li
 
 def parse_wrmap(wikitext: str) -> dict:
     """Parses the '<wrmap ...>content</wrmap>' of the Winterrodeln wrmap extension.
 
 def parse_wrmap(wikitext: str) -> dict:
     """Parses the '<wrmap ...>content</wrmap>' of the Winterrodeln wrmap extension.
-    If wikitext does not contain the <wrmap> tag or if the <wrmap> tag contains 
+    If wikitext does not contain the <wrmap> tag or if the <wrmap> tag contains
     invalid formatted lines, a ParseError is raised.
     Use wrpylib.mwmarkup.find_tag(wikitext, 'wrmap') to find the wrmap tag within an arbitrary
     wikitext before using this function.
     invalid formatted lines, a ParseError is raised.
     Use wrpylib.mwmarkup.find_tag(wikitext, 'wrmap') to find the wrmap tag within an arbitrary
     wikitext before using this function.
@@ -270,7 +270,7 @@ def parse_wrmap(wikitext: str) -> dict:
             wrong_properties = set(feature.attrib.keys()) - allowed_properties
             if len(wrong_properties) > 0:
                 raise ParseError(f"The attribute '{list(wrong_properties)[0]}' is not allowed at <{feature.tag}>.")
             wrong_properties = set(feature.attrib.keys()) - allowed_properties
             if len(wrong_properties) > 0:
                 raise ParseError(f"The attribute '{list(wrong_properties)[0]}' is not allowed at <{feature.tag}>.")
-            if 'farbe' in feature.attrib: 
+            if 'farbe' in feature.attrib:
                 if not re.match('#[0-9a-fA-F]{6}$', feature.attrib['farbe']):
                     raise ParseError('The attribute "farbe" has to have a format like "#a0bb43".')
                 properties['strokeColor'] = feature.attrib['farbe']  # e.g. #a200b7
                 if not re.match('#[0-9a-fA-F]{6}$', feature.attrib['farbe']):
                     raise ParseError('The attribute "farbe" has to have a format like "#a0bb43".')
                 properties['strokeColor'] = feature.attrib['farbe']  # e.g. #a200b7
@@ -313,7 +313,7 @@ def create_wrmap_coordinates(coords):
     for coord in coords:
         result.append(f'{coord[1]:.6f} N {coord[0]:.6f} E')
     return '\n'.join(result)
     for coord in coords:
         result.append(f'{coord[1]:.6f} N {coord[0]:.6f} E')
     return '\n'.join(result)
+
 
 def create_wrmap(geojson: Dict) -> str:
     """Creates a <wrmap> wikitext from geojson (as python types)."""
 
 def create_wrmap(geojson: Dict) -> str:
     """Creates a <wrmap> wikitext from geojson (as python types)."""