Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
caosdb-advanced-user-tools
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
caosdb
Software
caosdb-advanced-user-tools
Commits
d5f4e612
Commit
d5f4e612
authored
5 years ago
by
Henrik tom Wörden
Browse files
Options
Downloads
Plain Diff
Merge branch 'logging-setup' into tmp
parents
74dfe2c4
8d930813
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/caosadvancedtools/suppressKnown.py
+10
-0
10 additions, 0 deletions
src/caosadvancedtools/suppressKnown.py
src/caosadvancedtools/table_importer.py
+4
-1
4 additions, 1 deletion
src/caosadvancedtools/table_importer.py
with
14 additions
and
1 deletion
src/caosadvancedtools/suppressKnown.py
+
10
−
0
View file @
d5f4e612
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
src/caosadvancedtools/table_importer.py
+
4
−
1
View file @
d5f4e612
...
@@ -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
())
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment