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
0a8ba937
Commit
0a8ba937
authored
Dec 30, 2023
by
BO ZHANG
🏀
Browse files
add verbose info for Message.preview()
parent
6dcd47aa
Pipeline
#2882
passed with stage
in 0 seconds
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
csst_common/pipeline.py
View file @
0a8ba937
...
...
@@ -200,6 +200,10 @@ class Pipeline:
"""Move file `file_src` to `file_dist`."""
shutil
.
copy
(
file_src
,
file_dst
)
def
copy_to_output
(
self
,
file_paths
:
list
):
for
file_path
in
file_paths
:
pass
def
call
(
self
,
func
:
Callable
,
*
args
:
Any
,
**
kwargs
:
Any
):
self
.
pipeline_logger
.
info
(
f
"====================================================="
...
...
@@ -301,10 +305,13 @@ class Message:
def
preview
(
self
,
dlist
:
list
[
dict
],
n
:
int
=
10
)
->
None
:
"""Preview top `n` messages."""
print
(
f
"No. of messages =
{
len
(
dlist
)
}
"
)
print
(
f
"=========== Top
{
n
}
==========="
)
s
=
""
for
d
in
dlist
[:
n
]:
s
+=
self
.
dict2msg
(
d
)
+
"
\n
"
print
(
s
)
print
(
""
)
@
staticmethod
def
dict2msg
(
d
:
dict
):
...
...
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