# HG changeset patch # User Goffi # Date 1498605709 -7200 # Node ID 637886ac35f644c3e194c1fa9ca07eb0dbdab995 # Parent 5cd45a79775b4d060b0472d1164e1b01e3e171cf jp (base): added no_lf in disp() to avoid printing a line feed diff -r 5cd45a79775b -r 637886ac35f6 frontends/src/jp/base.py --- a/frontends/src/jp/base.py Wed Jun 28 01:20:44 2017 +0200 +++ b/frontends/src/jp/base.py Wed Jun 28 01:21:49 2017 +0200 @@ -244,18 +244,25 @@ for cache_data in cache: cache_data[0](*cache_data[1:]) - def disp(self, msg, verbosity=0, error=False): + def disp(self, msg, verbosity=0, error=False, no_lf=False): """Print a message to user @param msg(unicode): message to print @param verbosity(int): minimal verbosity to display the message @param error(bool): if True, print to stderr instead of stdout + @param no_lf(bool): if True, do not emit line feed at the end of line """ if self.verbosity >= verbosity: if error: - print >>sys.stderr,msg.encode('utf-8') + if no_lf: + print >>sys.stderr,msg.encode('utf-8'), + else: + print >>sys.stderr,msg.encode('utf-8') else: - print msg.encode('utf-8') + if no_lf: + print msg.encode('utf-8'), + else: + print msg.encode('utf-8') def output(self, type_, name, extra_outputs, data): if name in extra_outputs: @@ -762,8 +769,8 @@ """ self.disp(_(u"Error while doing operation: {}").format(error_msg), error=True) - def disp(self, msg, verbosity=0, error=False): - return self.host.disp(msg, verbosity, error) + def disp(self, msg, verbosity=0, error=False, no_lf=False): + return self.host.disp(msg, verbosity, error, no_lf) def output(self, data): try: