URI decoding: fixed reading a taxonomy before any view

This commit is contained in:
mercierc
2021-05-31 16:57:20 +12:00
parent c884615522
commit da91ffc2c7

View File

@ -192,7 +192,7 @@ def open_uri(uri,
config = getConfiguration() config = getConfiguration()
urip = urlparse(urib) urip = urlparse(urib)
if 'obi' not in config: if 'obi' not in config:
config['obi']={} config['obi']={}
@ -209,13 +209,14 @@ def open_uri(uri,
scheme = urip.scheme scheme = urip.scheme
error = None error = None
if urib != b"-" and \ if b'/taxonomy/' in urib or \
(urib != b"-" and \
(scheme==b"dms" or \ (scheme==b"dms" or \
(scheme==b"" and \ (scheme==b"" and \
(((not input) and "outputformat" not in config["obi"]) or \ (((not input) and "outputformat" not in config["obi"]) or \
(input and "inputformat" not in config["obi"])))): # TODO maybe not best way (input and "inputformat" not in config["obi"]))))): # TODO maybe not best way
if default_dms is not None and b"/" not in urip.path: # assuming view to open in default DMS (TODO discuss) if default_dms is not None and b"/" not in urip.path: # assuming view to open in default DMS (TODO discuss)
dms=(default_dms, urip.path) dms=(default_dms, urip.path)
else: else:
@ -223,7 +224,7 @@ def open_uri(uri,
if dms is None and default_dms is not None: 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: if dms is not None:
if dms_only: if dms_only:
return (dms[0], return (dms[0],
@ -248,7 +249,7 @@ def open_uri(uri,
if default_dms is None: if default_dms is None:
config["obi"]["defaultdms"]=resource[0] config["obi"]["defaultdms"]=resource[0]
return (resource[0], return (resource[0],
resource[1], resource[1],
type(resource[1]), type(resource[1]),
@ -464,7 +465,7 @@ def open_uri(uri,
if format is not None: if format is not None:
if seqtype==b"nuc": if seqtype==b"nuc":
objclass = Nuc_Seq # Nuc_Seq_Stored? TODO objclass = Nuc_Seq # Nuc_Seq_Stored? TODO
if format==b"fasta" or format==b"silva": if format==b"fasta" or format==b"silva" or format==b"rdp":
if input: if input:
iseq = fastaNucIterator(file, iseq = fastaNucIterator(file,
skip=skip, skip=skip,