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,15 +166,15 @@ 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:
resource=open_dms_element(dms[0],dms[1],
create,
newviewtype
)
scheme=b"dms"
urip = ParseResultBytes(scheme=b"dms",
netloc=urip.netloc,
@ -185,7 +185,7 @@ def open_uri(uri,
if default_dms is None:
config["obi"]["defaultdms"]=resource[0]
return (resource[0],
resource[1],
type(resource[1]),