cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brandonwilli...@apache.org
Subject git commit: cqlsh: fix col. width in presence of wide unicode glyphs Patch by paul cannon, reviewed by brandonwilliams for CASSANDRA-4033
Date Tue, 27 Mar 2012 18:51:31 GMT
Updated Branches:
  refs/heads/cassandra-1.0 46689e51b -> 9fc1d5c23


cqlsh: fix col. width in presence of wide unicode glyphs
Patch by paul cannon, reviewed by brandonwilliams for CASSANDRA-4033


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/9fc1d5c2
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/9fc1d5c2
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/9fc1d5c2

Branch: refs/heads/cassandra-1.0
Commit: 9fc1d5c23a58e06e104b94271b25fdf2eb048ed4
Parents: 46689e5
Author: Brandon Williams <brandonwilliams@apache.org>
Authored: Tue Mar 27 13:51:02 2012 -0500
Committer: Brandon Williams <brandonwilliams@apache.org>
Committed: Tue Mar 27 13:51:02 2012 -0500

----------------------------------------------------------------------
 bin/cqlsh |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/9fc1d5c2/bin/cqlsh
----------------------------------------------------------------------
diff --git a/bin/cqlsh b/bin/cqlsh
index 027b65e..8a9d98c 100755
--- a/bin/cqlsh
+++ b/bin/cqlsh
@@ -742,10 +742,10 @@ class Shell(cmd.Cmd):
         formatted_data = [map(self.myformat_value, row, coltypes) for row in cursor]
 
         # determine column widths
-        widths = map(len, formatted_names)
+        widths = [n.displaywidth for n in formatted_names]
         for fmtrow in formatted_data:
             for num, col in enumerate(fmtrow):
-                widths[num] = max(widths[num], len(col))
+                widths[num] = max(widths[num], col.displaywidth)
 
         # print header
         header = ' | '.join(hdr.color_ljust(w) for (hdr, w) in zip(formatted_names, widths))


Mime
View raw message