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
a39acbc0
Commit
a39acbc0
authored
Dec 30, 2023
by
BO ZHANG
🏀
Browse files
add Message.preview()
parent
f15ab7e7
Changes
1
Hide whitespace changes
Inline
Side-by-side
csst_common/pipeline.py
View file @
a39acbc0
...
...
@@ -289,6 +289,13 @@ class Message:
for
d
in
dlist
:
f
.
write
(
self
.
dict2msg
(
d
)
+
"
\n
"
)
def
preview
(
self
,
dlist
:
list
[
dict
])
->
str
:
"""Preview messages."""
s
=
""
for
d
in
dlist
:
s
+=
self
.
dict2msg
(
d
)
+
"
\n
"
print
(
s
)
@
staticmethod
def
dict2msg
(
d
:
dict
):
"""Convert `dict` to JSON format string."""
...
...
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