Fixed a bug with taxonomy URIs not being read correctly

This commit is contained in:
Celine Mercier
2017-10-04 16:00:30 +02:00
parent 09a5f89849
commit fb9b219abe

View File

@ -67,10 +67,10 @@ def open_dms_element(DMS dms, bytes path,
if path_parts[0]==b"taxonomy":
if len(path_parts) > 1:
taxo = Taxonomy.open(dms,path_parts[1])
if len(path_parts) == 2:
if len(path_parts) == 3:
taxon=taxo[int(path_parts[2])]
return (dms,taxon)
elif len(path_parts) > 2:
elif len(path_parts) > 3:
raise MalformedURIException('Malformed Taxonomy URI')
return (dms,taxo)
@ -166,8 +166,7 @@ def open_uri(uri,
if scheme==b"" or scheme==b"dms" :
dms = open_dms(urip.path,create)
if dms is None and default_dms is not None:
dms=(default_dms,urip.path)
dms=(default_dms, urip.path)
if dms is not None:
try:
@ -175,6 +174,7 @@ def open_uri(uri,
create,
newviewtype
)
scheme=b"dms"
urip = ParseResultBytes(scheme=b"dms",
netloc=urip.netloc,