def _reads_exist(self, attribute, value):
if isinstance(value, str):
if not os.path.exists(value):
raise FileNotFoundError('Reads file {} does not exist!'.format(value))
if not os.path.isfile(value):
raise OSError('{} is not a valid reads file'.format(value))
elif isinstance(value, list):
for x in value:
if not isinstance(x, str):
raise Exception(
'Reads file not specified as string or list of string: type={} "{}"'.format(type(x), x))
if not os.path.exists(x):
raise FileNotFoundError('Reads file {} does not exist!'.format(x))
if not os.path.isfile(x):
raise OSError('{} is not a valid reads file'.format(x))
else:
raise Exception(
'Reads file(s) not specified as string or list of string: type={} "{}"'.format(type(value), value))
评论列表
文章目录