Skip to content
GitLab
Explore
Projects
Groups
Snippets
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
1 year ago
by
BO ZHANG
Browse files
Options
Download
Email Patches
Plain Diff
add Message.preview()
parent
f15ab7e7
dev
main
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
csst_common/pipeline.py
+7
-0
csst_common/pipeline.py
with
7 additions
and
0 deletions
+7
-0
csst_common/pipeline.py
+
7
-
0
View file @
a39acbc0
...
@@ -289,6 +289,13 @@ class Message:
...
@@ -289,6 +289,13 @@ class Message:
for
d
in
dlist
:
for
d
in
dlist
:
f
.
write
(
self
.
dict2msg
(
d
)
+
"
\n
"
)
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
@
staticmethod
def
dict2msg
(
d
:
dict
):
def
dict2msg
(
d
:
dict
):
"""Convert `dict` to JSON format string."""
"""Convert `dict` to JSON format string."""
...
...
This diff is collapsed.
Click to expand it.
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
Menu
Explore
Projects
Groups
Snippets