From da91ffc2c723bb7945b2d056f13a1ac8d8f31fcb Mon Sep 17 00:00:00 2001 From: mercierc Date: Mon, 31 May 2021 16:57:20 +1200 Subject: [PATCH] URI decoding: fixed reading a taxonomy before any view --- python/obitools3/uri/decode.pyx | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/python/obitools3/uri/decode.pyx b/python/obitools3/uri/decode.pyx index fc424eb..d88c187 100644 --- a/python/obitools3/uri/decode.pyx +++ b/python/obitools3/uri/decode.pyx @@ -192,7 +192,7 @@ def open_uri(uri, config = getConfiguration() urip = urlparse(urib) - + if 'obi' not in config: config['obi']={} @@ -209,13 +209,14 @@ def open_uri(uri, scheme = urip.scheme error = None - - if urib != b"-" and \ + + if b'/taxonomy/' in urib or \ + (urib != b"-" and \ (scheme==b"dms" or \ (scheme==b"" and \ (((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) dms=(default_dms, urip.path) else: @@ -223,7 +224,7 @@ def open_uri(uri, if dms is None and default_dms is not None: dms=(default_dms, urip.path) - + if dms is not None: if dms_only: return (dms[0], @@ -248,7 +249,7 @@ def open_uri(uri, if default_dms is None: config["obi"]["defaultdms"]=resource[0] - + return (resource[0], resource[1], type(resource[1]), @@ -464,7 +465,7 @@ def open_uri(uri, if format is not None: if seqtype==b"nuc": 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: iseq = fastaNucIterator(file, skip=skip,