From 2386a30fef26180e0e8fcf12b377886d3be23e62 Mon Sep 17 00:00:00 2001 From: Harel Ben-Attia Date: Mon, 26 Jan 2015 13:08:47 -0500 Subject: Fixed bug #89 - Output formatting attempts to apply to header row --- bin/q | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'bin') diff --git a/bin/q b/bin/q index 62b7894..a944876 100755 --- a/bin/q +++ b/bin/q @@ -27,7 +27,7 @@ # # Run with --help for command line details # -q_version = "1.5.0" +q_version = "1.6.0notreleasedyet" __all__ = [ 'QTextAsData' ] @@ -1353,8 +1353,9 @@ class QOutputPrinter(object): data.insert(0,results.metadata.output_column_name_list) for rownum, row in enumerate(data): row_str = [] + skip_formatting = rownum == 0 and self.output_params.output_header for i, col in enumerate(row): - if formatting_dict is not None and str(i + 1) in formatting_dict.keys(): + if formatting_dict is not None and str(i + 1) in formatting_dict.keys() and not skip_formatting: fmt_str = formatting_dict[str(i + 1)] else: if self.output_params.beautify: @@ -1371,6 +1372,9 @@ class QOutputPrinter(object): except (UnicodeEncodeError, UnicodeError), e: print >>sys.stderr, "Cannot encode data. Error:%s" % e sys.exit(3) + except TypeError,e: + print >>sys.stderr, "Error while formatting output: %s" % e + sys.exit(4) except IOError, e: if e.errno == 32: # broken pipe, that's ok -- cgit v1.2.3