def can_resolve(self, uri_path, from_resource=None):
uri_path = Resource.normalize(uri_path)
fragment = uri_path.rsplit('#', maxsplit=1)
if len(fragment) == 2:
uri_str, fragment = fragment
else:
return False
if uri_str in self.resources:
return True
start = from_resource.uri.normalize() if from_resource else '.'
apath = path.dirname(start)
uri = URI(path.join(apath, uri_str))
return uri.normalize() in self.resources
评论列表
文章目录