Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
bis-aria
ariaec
Commits
0465e1be
Commit
0465e1be
authored
Jun 28, 2019
by
Fabrice ALLAIN
Browse files
fix: remove logger during serialization for distance restraint class
parent
d816e53f
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/aria/core/tools.py
View file @
0465e1be
...
...
@@ -82,11 +82,18 @@ def Dump(this, filename, mode='w', as_string=0, gzip=0):
open_func
=
open
# Issues if we try to dump the logger since it contains the log file instance
for
foo
in
this
.
items
():
# foo = getattr(this, foo)
print
(
foo
)
if
hasattr
(
foo
,
"logger"
):
delattr
(
foo
,
"logger"
)
# TODO: do better testing
def
remove_logger
(
this
):
if
hasattr
(
elt
,
"items"
):
for
foo
in
elt
.
items
():
if
hasattr
(
foo
,
"logger"
):
delattr
(
foo
,
"logger"
)
if
type
(
this
)
==
list
:
for
elt
in
this
:
remove_logger
(
elt
)
else
:
remove_logger
(
this
)
f
=
open_func
(
filename
,
mode
)
try
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment