diff --git a/src/caosadvancedtools/suppressKnown.py b/src/caosadvancedtools/suppressKnown.py index 61b016052a89db3d157f5f6e8d0562f88ee22131..c15f0e06fa7d126937497aeb877dd5d2991b6ff7 100644 --- a/src/caosadvancedtools/suppressKnown.py +++ b/src/caosadvancedtools/suppressKnown.py @@ -71,6 +71,16 @@ class SuppressKnown(logging.Filter): return sha256((txt+str(identifier)).encode("utf-8")).hexdigest() 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"): return 1 diff --git a/src/caosadvancedtools/table_importer.py b/src/caosadvancedtools/table_importer.py index 6b9be807a5a34806139023d185ac3fb01e33e10f..1abeba95db6eab8c8e30945db2a94bb894bee00d 100755 --- a/src/caosadvancedtools/table_importer.py +++ b/src/caosadvancedtools/table_importer.py @@ -40,7 +40,7 @@ from .suppressKnown import SuppressKnown logger = logging.getLogger(__name__) -def name_converter(name): +def assure_name_format(name): """ checks whether a string can be interpreted as 'LastName, FirstName' """ @@ -87,6 +87,9 @@ class XLS_Importer(object): necessary. obligatory_columns: list of column names, optional 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.required_columns = list(converters.keys())