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_proto
Commits
96d7860b
Commit
96d7860b
authored
Oct 20, 2022
by
BO ZHANG
🏀
Browse files
added an example of collecting file records
parent
12f625e6
Pipeline
#232
passed with stages
in 20 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
doc/source/ch08_csst_common.rst
View file @
96d7860b
...
...
@@ -139,6 +139,27 @@ Use ``FileRecorder.add_record()`` to add file records.
test001.txt True Test file 1 False
test002.txt True Test file 2 False
`FileRecorder` inherits from `list`.
Therefore, if you are collecting records from subprocesses,
here is the way to combine records:
.. code-block:: python
:linenos:
>>> from csst_common.file_recorder import FileRecorder
>>> fr1 = FileRecorder()
>>> fr1.add_record(filepath="test1.txt", db=False, comment="test file 1")
>>> fr2 = FileRecorder()
>>> fr2.add_record(filepath="test2.txt", db=False, comment="test file 2")
>>> fr_all = FileRecorder([*fr1, *fr2])
>>> fr_all.pprint_all()
<FileRecorder length=2>
filepath db comment existence
--------- ----- ----------- ---------
test1.txt False test file 1 False
test2.txt False test file 2 False
``csst_common.logger.get_logger()``
-----------------------------------
...
...
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