diff options
author | Harel Ben-Attia <harelba@gmail.com> | 2015-01-26 13:08:47 -0500 |
---|---|---|
committer | Harel Ben-Attia <harelba@gmail.com> | 2015-01-26 13:08:47 -0500 |
commit | 2386a30fef26180e0e8fcf12b377886d3be23e62 (patch) | |
tree | 31eb61598f8b3f15c62508c79e70bafe61823d59 /bin | |
parent | c7e1deab35949356496fcff5322d9992cb45678f (diff) |
Fixed bug #89 - Output formatting attempts to apply to header row
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/q | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -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 |