def get_filepath_from_system(datafile, system_name, *args):
""" This function takes variable number of tag names as input and
returns a list of absolute paths for all the tag values.
In case of non-string tag values, it will simply return those
non-string values.
"""
abspath_lst = []
credentials = get_credentials(datafile, system_name, args)
start_directory = os.path.dirname(datafile)
for tag in args:
if isinstance(credentials[tag], str) or credentials[tag] is False:
abspath = file_Utils.getAbsPath(credentials[tag], start_directory)
if abspath:
if os.path.isfile(abspath):
abspath_lst.append(abspath)
else:
print_warning("File '{0}' provided for tag '{1}' does not "
"exist".format(abspath, tag))
abspath_lst.append(None)
else:
abspath_lst.append(None)
else:
abspath_lst.append(credentials[tag])
return abspath_lst
评论列表
文章目录