Loading csst_common/file_recorder.py +6 −3 Original line number Original line Diff line number Diff line Loading @@ -2,7 +2,6 @@ from collections import namedtuple from astropy import table from astropy import table import os import os File = namedtuple( File = namedtuple( "FileRecord", "FileRecord", ["filepath", "db", "comment", "existence"] ["filepath", "db", "comment", "existence"] Loading Loading @@ -52,8 +51,12 @@ class FileRecorder(list): test002.txt True Test file 2 False test002.txt True Test file 2 False """ """ def __init__(self): def __init__(self, *args, **kwargs): super(FileRecorder, self).__init__() 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 = ""): def add_record(self, filepath: str = "", db: bool = False, comment: str = ""): existence = os.path.exists(filepath) existence = os.path.exists(filepath) Loading Loading
csst_common/file_recorder.py +6 −3 Original line number Original line Diff line number Diff line Loading @@ -2,7 +2,6 @@ from collections import namedtuple from astropy import table from astropy import table import os import os File = namedtuple( File = namedtuple( "FileRecord", "FileRecord", ["filepath", "db", "comment", "existence"] ["filepath", "db", "comment", "existence"] Loading Loading @@ -52,8 +51,12 @@ class FileRecorder(list): test002.txt True Test file 2 False test002.txt True Test file 2 False """ """ def __init__(self): def __init__(self, *args, **kwargs): super(FileRecorder, self).__init__() 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 = ""): def add_record(self, filepath: str = "", db: bool = False, comment: str = ""): existence = os.path.exists(filepath) existence = os.path.exists(filepath) Loading