def get_local_path(self, img, pfmri):
"""Return an opener for the license text from the local disk or
None if the data for the text is not on-disk."""
if img.version <= 3:
# Older images stored licenses without accounting for
# '/', spaces, etc. properly.
path = os.path.join(img.get_license_dir(pfmri),
"license." + self.attrs["license"])
else:
# Newer images ensure licenses are stored with encoded
# name so that '/', spaces, etc. are properly handled.
path = os.path.join(img.get_license_dir(pfmri),
"license." + quote(self.attrs["license"],
""))
return path
评论列表
文章目录