def uri(self, value):
caom_util.type_check(value, str, "uri", override=False)
tmp = urlsplit(value)
if tmp.scheme != ObservationURI._SCHEME:
raise ValueError("{} doesn't have an allowed scheme".format(value))
if tmp.geturl() != value:
raise ValueError("Failed to parse uri correctly: {}".format(value))
(collection, observation_id, product_id) = tmp.path.split("/")
if product_id is None:
raise ValueError("Faield to get product ID from uri: {}"
.format(value))
self._product_id = product_id
self._observation_uri = \
ObservationURI.get_observation_uri(collection, observation_id)
self._uri = value
评论列表
文章目录