From 1e5a8561c09f65e390ec51f2322919dd187bfbdf Mon Sep 17 00:00:00 2001 From: Sarah Hoffmann Date: Thu, 20 Jan 2022 16:00:23 +0100 Subject: [PATCH] fix linting issues --- nominatim/tokenizer/sanitizers/clean_housenumbers.py | 6 ++++-- nominatim/tokenizer/sanitizers/split_name_list.py | 1 - nominatim/tokenizer/sanitizers/tag_analyzer_by_language.py | 2 -- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/nominatim/tokenizer/sanitizers/clean_housenumbers.py b/nominatim/tokenizer/sanitizers/clean_housenumbers.py index 85af903b..49f9b4f0 100644 --- a/nominatim/tokenizer/sanitizers/clean_housenumbers.py +++ b/nominatim/tokenizer/sanitizers/clean_housenumbers.py @@ -37,7 +37,8 @@ class _HousenumberSanitizer: new_address = [] for item in obj.address: if self.filter_kind(item): - new_address.extend(item.clone(kind='housenumber', name=n) for n in self.sanitize(item.name)) + new_address.extend(item.clone(kind='housenumber', name=n) + for n in self.sanitize(item.name)) else: # Don't touch other address items. new_address.append(item) @@ -56,7 +57,8 @@ class _HousenumberSanitizer: yield from self._regularize(hnr) - def _regularize(self, hnr): + @staticmethod + def _regularize(hnr): yield hnr diff --git a/nominatim/tokenizer/sanitizers/split_name_list.py b/nominatim/tokenizer/sanitizers/split_name_list.py index b2a2045f..13921c3e 100644 --- a/nominatim/tokenizer/sanitizers/split_name_list.py +++ b/nominatim/tokenizer/sanitizers/split_name_list.py @@ -11,7 +11,6 @@ Arguments: delimiters: Define the set of characters to be used for splitting the list. (default: ',;') """ -from nominatim.errors import UsageError from nominatim.tokenizer.sanitizers.helpers import create_split_regex def create(func): diff --git a/nominatim/tokenizer/sanitizers/tag_analyzer_by_language.py b/nominatim/tokenizer/sanitizers/tag_analyzer_by_language.py index 964a9016..cbf32179 100644 --- a/nominatim/tokenizer/sanitizers/tag_analyzer_by_language.py +++ b/nominatim/tokenizer/sanitizers/tag_analyzer_by_language.py @@ -30,8 +30,6 @@ Arguments: any analyzer tagged) is retained. (default: replace) """ -import re - from nominatim.tools import country_info from nominatim.tokenizer.sanitizers.helpers import create_kind_filter -- 2.39.5