def __init__(self, extention): ''' :param extention: The extention of the source archive. :type extention: str ''' Artifact.__init__(self, 'archive.{}'.format(extention), 'Source code ({})'.format(extention), '', '', 'compression')
def __init__(self, folder, desc_file, desc_ext): ''' :param folder: The folder where files can be found. :param desc_file: The name of the description file. :param desc_ext: The extention of the description file. :type folder: str :type desc_file: str :type desc_ext: str ''' try: description = json.load(open(desc_file)) except json.decoder.JSONDecodeError: print('CRITICAL Description file {} could not be read'.format( desc_file)) exit(1) self.tag = description['version'] self.job = description['job'] file_name = desc_file[:-len(desc_ext)] Artifact.__init__(self, file_name, description['category'], description['arch'], description['type'], 'package')