diff --git a/nesoni/CHANGES b/nesoni/CHANGES index c6d7b60..bb7ab02 100644 --- a/nesoni/CHANGES +++ b/nesoni/CHANGES @@ -1,4 +1,6 @@ +0.130 - grace.status returns old status, bam reader restores old status after finishing + 0.129 - slight tweak to error reporting don't require SplitsTree to be installed diff --git a/nesoni/__init__.py b/nesoni/__init__.py index 0e518ab..8b3eff0 100644 --- a/nesoni/__init__.py +++ b/nesoni/__init__.py @@ -1,4 +1,4 @@ -VERSION='0.129' +VERSION='0.130' #^ Note: this first line is read by the setup.py script to get the version import sys diff --git a/nesoni/grace.py b/nesoni/grace.py index 157e0ab..36a5150 100644 --- a/nesoni/grace.py +++ b/nesoni/grace.py @@ -81,14 +81,8 @@ def __exit__(self): def status(string): """ Display a status string. """ from nesoni import legion - legion.coordinator().set_status( legion.process_identity(), string ) - #if sys.stderr.isatty(): - # #Show in terminal title - # sys.stderr.write('\x1b]2;'+string+'\x07') - # sys.stderr.flush() - # - # #sys.stderr.write('\r\x1b[K\x1b[34m' + string + '\x1b[m\r') - # #sys.stderr.flush() + return legion.coordinator().set_status( legion.process_identity(), string ) + def load(module_name): status('Loading') diff --git a/nesoni/legion.py b/nesoni/legion.py index b38a90a..684c515 100644 --- a/nesoni/legion.py +++ b/nesoni/legion.py @@ -287,6 +287,7 @@ def acquire_core(self): self.trade_cores(0,1) def set_status(self, identity, value): + old = self.statuses.get(identity,"") if value: self.statuses[identity] = value elif identity in self.statuses: @@ -305,6 +306,8 @@ def set_status(self, identity, value): #Show in terminal title sys.stderr.write('\x1b]2;'+status+'\x07') sys.stderr.flush() + + return old def job(self, func, *args, **kwargs): number = self.set_mail((func,args,kwargs)) @@ -870,11 +873,11 @@ def _make_inner(action): if LOCAL.abort_make and not selection.matches(LOCAL.do_selection, [action.shell_name()]): raise grace.Error('%s would be run. Stopping here.' % action.ident()) - grace.status(action.ident()) + old_status = grace.status(action.shell_name()) try: _run_and_save_state(action, timestamp) finally: - grace.status('') + grace.status(old_status) finally: if cores > 1: coordinator().trade_cores(cores, 1) diff --git a/nesoni/nesoni-r/R/nesoni_version.R b/nesoni/nesoni-r/R/nesoni_version.R index 7733a0d..96e8d3a 100644 --- a/nesoni/nesoni-r/R/nesoni_version.R +++ b/nesoni/nesoni-r/R/nesoni_version.R @@ -1,2 +1,2 @@ #Autogenerated -nesoni_version <- function() { '0.128' } +nesoni_version <- function() { '0.129' } diff --git a/nesoni/sam.py b/nesoni/sam.py index 08ec746..16bdfaf 100644 --- a/nesoni/sam.py +++ b/nesoni/sam.py @@ -224,6 +224,8 @@ def next(self): def bam_iter_fragments(filename, status_text='Processing'): reader = Bam_reader(filename) + + old_status = grace.status(status_text) n = 0 n_ambiguous = 0 @@ -280,7 +282,7 @@ def bam_iter_fragments(filename, status_text='Processing'): yield read_name, pairs + unpaired, unmapped - grace.status('') + grace.status(old_status) if n_ambiguous: print >> sys.stderr print >> sys.stderr, 'The alignment pairing was unclear %s times, and alignments were paired arbitrarily.' % grace.pretty_number(n_ambiguous)