]> git.openstreetmap.org Git - nominatim.git/blobdiff - src/nominatim_db/tokenizer/sanitizers/clean_postcodes.py
fix style issue found by flake8
[nominatim.git] / src / nominatim_db / tokenizer / sanitizers / clean_postcodes.py
index 5340dc8ce26aaba436832abf11a9c7cfc672edd4..9bdf363c5b313d7e5d59a26098163c958e346677 100644 (file)
@@ -26,6 +26,7 @@ from ...data.postcode_format import PostcodeFormatter
 from .base import ProcessInfo
 from .config import SanitizerConfig
 
 from .base import ProcessInfo
 from .config import SanitizerConfig
 
+
 class _PostcodeSanitizer:
 
     def __init__(self, config: SanitizerConfig) -> None:
 class _PostcodeSanitizer:
 
     def __init__(self, config: SanitizerConfig) -> None:
@@ -36,7 +37,6 @@ class _PostcodeSanitizer:
         if default_pattern is not None and isinstance(default_pattern, str):
             self.matcher.set_default_pattern(default_pattern)
 
         if default_pattern is not None and isinstance(default_pattern, str):
             self.matcher.set_default_pattern(default_pattern)
 
-
     def __call__(self, obj: ProcessInfo) -> None:
         if not obj.address:
             return
     def __call__(self, obj: ProcessInfo) -> None:
         if not obj.address:
             return
@@ -55,7 +55,6 @@ class _PostcodeSanitizer:
                 postcode.name = formatted[0]
                 postcode.set_attr('variant', formatted[1])
 
                 postcode.name = formatted[0]
                 postcode.set_attr('variant', formatted[1])
 
-
     def scan(self, postcode: str, country: Optional[str]) -> Optional[Tuple[str, str]]:
         """ Check the postcode for correct formatting and return the
             normalized version. Returns None if the postcode does not
     def scan(self, postcode: str, country: Optional[str]) -> Optional[Tuple[str, str]]:
         """ Check the postcode for correct formatting and return the
             normalized version. Returns None if the postcode does not
@@ -67,10 +66,8 @@ class _PostcodeSanitizer:
 
         assert country is not None
 
 
         assert country is not None
 
-        return self.matcher.normalize(country, match),\
-               ' '.join(filter(lambda p: p is not None, match.groups()))
-
-
+        return self.matcher.normalize(country, match), \
+            ' '.join(filter(lambda p: p is not None, match.groups()))
 
 
 def create(config: SanitizerConfig) -> Callable[[ProcessInfo], None]:
 
 
 def create(config: SanitizerConfig) -> Callable[[ProcessInfo], None]: