8000 some fixes after review · pythonthings/q@1319aeb · GitHub
[go: up one dir, main page]

Skip to content

Commit 1319aeb

Browse files
committed
some fixes after review
1 parent f83f681 commit 1319aeb

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ matrix:
1010
- python: "3.6"
1111
- python: "3.7"
1212
install: pip install -r requirements.txt
13-
before_script: flake8 ./bin/q --count --select=E901,E999,F821,F822,F823 --show-source --statistics
13+
before_script: flake8 ./bin/q ./test/test-suite --count --select=E901,E999,F821,F822,F823 --show-source --statistics
1414
script: test/test-all

bin/q

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1106,7 +1106,8 @@ def determine_max_col_lengths(m,output_field_quoting_func,output_delimiter):
11061106
max_lengths = [0 for x in range(0, len(m[0]))]
11071107
for row_index in range(0, len(m)):
11081108
for col_index in range(0, len(m[0])):
1109-
new_len = len(unicode(output_field_quoting_func(output_delimiter,m[row_index][col_index])))
1109+
# TODO Optimize this and make sure that py2 hack of float precision is applied here as well
1110+
new_len = len("{}".format(output_field_quoting_func(output_delimiter,m[row_index][col_index])))
11101111
if new_len > max_lengths[col_index]:
11111112
max_lengths[col_index] = new_len
11121113
return max_lengths
@@ -1591,7 +1592,7 @@ class QOutputPrinter(object):
15911592
fmt_str = formatting_dict[str(i + 1)]
15921593
else:
15931594
if self.output_params.beautify:
1594-
fmt_str = six.u("{{0:<{}}}") % max_lengths[i]
1595+
fmt_str = six.u("{{0:<{}}}").format(max_lengths[i])
15951596
else:
15961597
fmt_str = six.u("{}")
15971598

0 commit comments

Comments
 (0)
0