sample_metadata/parser/generic_parser.py
def create_file_object(
        self,
        filename: str,
        secondary_files: List[Dict[str, Any]] = None,
    ) -> Dict[str, Any]:
        """Takes filename, returns formed CWL dictionary"""
        checksum = None
        if not self.skip_checking_gcs_objects:
            md5_filename = self.file_path(filename + '.md5')
            if self.file_exists(md5_filename):
                contents = self.file_contents(md5_filename)
                if contents:
                    checksum = f'md5:{contents.strip()}'

        file_size = None
        if not self.skip_checking_gcs_objects:
            file_size = self.file_size(filename)

        d = {
            'location': self.file_path(filename),
            'basename': os.path.basename(filename),
            'class': 'File',
            'checksum': checksum,
            'size': file_size,
        }

        if secondary_files:
            d['secondaryFiles'] = secondary_files

        return d
Takes filename, returns formed CWL dictionary
Takes filename, returns formed CWL dictionary
Takes filename returns formed CWL dictionary
def create_file_object(
        self,
        filename: str,
        secondary_files: List[Dict[str, Any]] = None,
    ) -> Dict[str, Any]:
        checksum = None
        if not self.skip_checking_gcs_objects:
            md5_filename = self.file_path(filename + '.md5')
            if self.file_exists(md5_filename):
                contents = self.file_contents(md5_filename)
                if contents:
                    checksum = f'md5:{contents.strip()}'
        file_size = None
        if not self.skip_checking_gcs_objects:
            file_size = self.file_size(filename)
        d = {
            'location': self.file_path(filename),
            'basename': os.path.basename(filename),
            'class': 'File',
            'checksum': checksum,
            'size': file_size,
        }
        if secondary_files:
            d['secondaryFiles'] = secondary_files
        return d
def create_file_object ( self , filename : str , secondary_files : List [ Dict [ str , Any ] ] = None , ) -> Dict [ str , Any ] : checksum = None if not self . skip_checking_gcs_objects : md5_filename = self . file_path ( filename + '.md5' ) if self . file_exists ( md5_filename ) : contents = self . file_contents ( md5_filename ) if contents : checksum = f'md5:{contents.strip()}' file_size = None if not self . skip_checking_gcs_objects : file_size = self . file_size ( filename ) d = { 'location' : self . file_path ( filename ) , 'basename' : os . path . basename ( filename ) , 'class' : 'File' , 'checksum' : checksum , 'size' : file_size , } if secondary_files : d [ 'secondaryFiles' ] = secondary_files return d
Takes filename, returns formed CWL dictionary
Takes filename returns formed CWL dictionary
"""Takes filename, returns formed CWL dictionary"""
self
filename
str
secondary_files
List[Dict[str, Any]]