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
9fa37e4b
Commit
9fa37e4b
authored
Oct 20, 2022
by
BO ZHANG
🏀
Browse files
added FileRecorder.Record
parent
c2468010
Changes
1
Hide whitespace changes
Inline
Side-by-side
csst_common/file_recorder.py
View file @
9fa37e4b
...
...
@@ -2,7 +2,6 @@ from collections import namedtuple
from
astropy
import
table
import
os
File
=
namedtuple
(
"FileRecord"
,
[
"filepath"
,
"db"
,
"comment"
,
"existence"
]
...
...
@@ -52,8 +51,12 @@ class FileRecorder(list):
test002.txt True Test file 2 False
"""
def
__init__
(
self
):
super
(
FileRecorder
,
self
).
__init__
()
def
__init__
(
self
,
*
args
,
**
kwargs
):
super
(
FileRecorder
,
self
).
__init__
(
*
args
,
**
kwargs
)
@
staticmethod
def
Record
(
filepath
:
str
=
""
,
db
:
bool
=
False
,
comment
:
str
=
""
):
return
File
(
filepath
=
filepath
,
db
=
db
,
comment
=
comment
,
existence
=
os
.
path
.
exists
(
filepath
))
def
add_record
(
self
,
filepath
:
str
=
""
,
db
:
bool
=
False
,
comment
:
str
=
""
):
existence
=
os
.
path
.
exists
(
filepath
)
...
...
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