Improved progress display when importing files in a DMS
This commit is contained in:
@ -99,6 +99,7 @@ def run(config):
|
||||
logger("info", "obi import: imports an object (file(s), obiview, taxonomy...) into a DMS")
|
||||
|
||||
entry_count = -1
|
||||
pb = None
|
||||
|
||||
if not config['obi']['taxdump']:
|
||||
input = open_uri(config['obi']['inputURI'])
|
||||
@ -110,7 +111,10 @@ def run(config):
|
||||
else:
|
||||
entry_count = input[4]
|
||||
|
||||
logger("info", "Importing %d entries", entry_count)
|
||||
if entry_count > 0:
|
||||
logger("info", "Importing %d entries", entry_count)
|
||||
else:
|
||||
logger("info", "Importing an unknow number of entries")
|
||||
|
||||
# TODO a bit dirty?
|
||||
if input[2]==Nuc_Seq or input[2]==View_NUC_SEQS:
|
||||
@ -137,8 +141,6 @@ def run(config):
|
||||
|
||||
if entry_count >= 0:
|
||||
pb = ProgressBar(entry_count, config, seconde=5)
|
||||
else:
|
||||
pb = None
|
||||
|
||||
entries = input[1]
|
||||
|
||||
@ -170,6 +172,9 @@ def run(config):
|
||||
|
||||
if pb is not None:
|
||||
pb(i)
|
||||
elif not i%50000:
|
||||
logger("info", "Imported %d entries", i)
|
||||
|
||||
|
||||
if NUC_SEQS_view:
|
||||
id_col[i] = entry.id
|
||||
|
Reference in New Issue
Block a user