Skip to content
Snippets Groups Projects
Commit d5f4e612 authored by Henrik tom Wörden's avatar Henrik tom Wörden
Browse files

Merge branch 'logging-setup' into tmp

parents 74dfe2c4 8d930813
No related branches found
No related tags found
No related merge requests found
...@@ -71,6 +71,16 @@ class SuppressKnown(logging.Filter): ...@@ -71,6 +71,16 @@ class SuppressKnown(logging.Filter):
return sha256((txt+str(identifier)).encode("utf-8")).hexdigest() return sha256((txt+str(identifier)).encode("utf-8")).hexdigest()
def filter(self, record): def filter(self, record):
"""
Return whether the record shall be logged.
If either identifier of category is missing 1 is returned (logging
enabled). If the record has both attributes, it is checked whether the
combination was shown before (was_tagged). If so 0 is returned.
Otherwise the combination is saved and 1 is returned
"""
if not hasattr(record, "identifier"): if not hasattr(record, "identifier"):
return 1 return 1
......
...@@ -40,7 +40,7 @@ from .suppressKnown import SuppressKnown ...@@ -40,7 +40,7 @@ from .suppressKnown import SuppressKnown
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
def name_converter(name): def assure_name_format(name):
""" """
checks whether a string can be interpreted as 'LastName, FirstName' checks whether a string can be interpreted as 'LastName, FirstName'
""" """
...@@ -87,6 +87,9 @@ class XLS_Importer(object): ...@@ -87,6 +87,9 @@ class XLS_Importer(object):
necessary. necessary.
obligatory_columns: list of column names, optional obligatory_columns: list of column names, optional
each listed column must not have missing values each listed column must not have missing values
unique_columns : list of column names that in
combination must be unique; i.e. each row has a
unique combination of values in those columns.
""" """
self.sup = SuppressKnown() self.sup = SuppressKnown()
self.required_columns = list(converters.keys()) self.required_columns = list(converters.keys())
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment