Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
csst-pipeline
csst_common
Commits
b70b7032
Commit
b70b7032
authored
Jul 17, 2023
by
BO ZHANG
🏀
Browse files
add error trace
parent
b52e4bb0
Changes
1
Hide whitespace changes
Inline
Side-by-side
csst_common/pipeline.py
View file @
b70b7032
...
...
@@ -54,6 +54,7 @@ class Pipeline:
self
.
message
=
Message
(
os
.
path
.
join
(
self
.
dir_out
,
"msg.txt"
))
self
.
time_stamp
=
TimeStamp
(
os
.
path
.
join
(
self
.
dir_out
,
"time_stamp.txt"
))
self
.
exit_code
=
ExitCode
(
os
.
path
.
join
(
self
.
dir_out
,
"exit_code"
))
self
.
error_trace
=
ErrorTrace
(
os
.
path
.
join
(
self
.
dir_out
,
"error_trace"
))
if
dfs
:
self
.
dfs
=
DFS
(
n_try
=
5
)
...
...
@@ -101,6 +102,18 @@ class Pipeline:
warnings
.
resetwarnings
()
class
ErrorTrace
:
def
__init__
(
self
,
file_path
=
""
):
self
.
file_path
=
file_path
def
__repr__
(
self
):
return
f
"< ErrorTrace [
{
self
.
file_path
}
] >"
def
write
(
self
,
s
:
str
):
with
open
(
self
.
file_path
,
"w+"
)
as
f
:
f
.
write
(
s
)
class
Message
:
def
__init__
(
self
,
file_path
=
""
):
self
.
file_path
=
file_path
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment