summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorHarel Ben-Attia <harelba@gmail.com>2015-01-26 13:08:47 -0500
committerHarel Ben-Attia <harelba@gmail.com>2015-01-26 13:08:47 -0500
commit2386a30fef26180e0e8fcf12b377886d3be23e62 (patch)
tree31eb61598f8b3f15c62508c79e70bafe61823d59 /bin
parentc7e1deab35949356496fcff5322d9992cb45678f (diff)
Fixed bug #89 - Output formatting attempts to apply to header row
Diffstat (limited to 'bin')
-rwxr-xr-xbin/q8
1 files changed, 6 insertions, 2 deletions
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