phoenix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jeffr...@apache.org
Subject git commit: PHOENIX-920: SqlLine shows funky characters when running on Windows
Date Fri, 11 Apr 2014 23:17:04 GMT
Repository: incubator-phoenix
Updated Branches:
  refs/heads/3.0 407a8a599 -> 8dbb8d69f


PHOENIX-920: SqlLine shows funky characters when running on Windows


Project: http://git-wip-us.apache.org/repos/asf/incubator-phoenix/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-phoenix/commit/8dbb8d69
Tree: http://git-wip-us.apache.org/repos/asf/incubator-phoenix/tree/8dbb8d69
Diff: http://git-wip-us.apache.org/repos/asf/incubator-phoenix/diff/8dbb8d69

Branch: refs/heads/3.0
Commit: 8dbb8d69ff546ea80c2e9d7385d0677264b59e5b
Parents: 407a8a5
Author: Jeffrey Zhong <jzhong@JZhongs-MacBook-Pro.local>
Authored: Fri Apr 11 16:20:03 2014 -0700
Committer: Jeffrey Zhong <jzhong@JZhongs-MacBook-Pro.local>
Committed: Fri Apr 11 16:22:02 2014 -0700

----------------------------------------------------------------------
 bin/psql.py    |  3 +++
 bin/sqlline.py | 16 ++++++++++++----
 2 files changed, 15 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-phoenix/blob/8dbb8d69/bin/psql.py
----------------------------------------------------------------------
diff --git a/bin/psql.py b/bin/psql.py
index c11580a..0fb578c 100755
--- a/bin/psql.py
+++ b/bin/psql.py
@@ -29,6 +29,9 @@ phoenix_jar_path = os.path.join(current_dir, "..", "phoenix-assembly",
                                 "target")
 phoenix_client_jar = phoenix_utils.find("phoenix-*-client.jar", phoenix_jar_path)
 
+if phoenix_client_jar == "":
+    phoenix_client_jar = phoenix_utils.find("phoenix-*-client.jar", os.path.join(current_dir,
".."))
+
 # HBase configuration folder path (where hbase-site.xml reside) for
 # HBase/Phoenix client side property override
 java_cmd = 'java -cp ".' + os.pathsep + current_dir + os.pathsep + phoenix_client_jar + \

http://git-wip-us.apache.org/repos/asf/incubator-phoenix/blob/8dbb8d69/bin/sqlline.py
----------------------------------------------------------------------
diff --git a/bin/sqlline.py b/bin/sqlline.py
index 08c6e94..491bd65 100755
--- a/bin/sqlline.py
+++ b/bin/sqlline.py
@@ -29,10 +29,13 @@ phoenix_jar_path = os.path.join(current_dir, "..", "phoenix-assembly",
                                 "target")
 phoenix_client_jar = phoenix_utils.find("phoenix-*-client.jar", phoenix_jar_path)
 
+if phoenix_client_jar == "":
+    phoenix_client_jar = phoenix_utils.find("phoenix-*-client.jar", os.path.join(current_dir,
".."))
+
 if len(sys.argv) < 2:
-    print "Zookeeper not specified. \nUsage: sqlline.sh <zookeeper> \
-<optional_sql_file> \nExample: \n 1. sqlline.sh localhost \n 2. sqlline.sh \
-localhost ../examples/stock_symbol.sql"
+    print "Zookeeper not specified. \nUsage: sqlline.py <zookeeper> \
+<optional_sql_file> \nExample: \n 1. sqlline.py localhost:2181:/hbase \n 2. sqlline.py
\
+localhost:2181:/hbase ../examples/stock_symbol.sql"
     sys.exit()
 
 sqlfile = ""
@@ -40,12 +43,17 @@ sqlfile = ""
 if len(sys.argv) > 2:
     sqlfile = "--run=" + sys.argv[2]
 
+colorSetting = "true"
+# disable color setting for windows OS
+if os.name == 'nt':
+    colorSetting = "false"
+
 java_cmd = 'java -cp ".' + os.pathsep + phoenix_client_jar + \
     '" -Dlog4j.configuration=file:' + \
     os.path.join(current_dir, "log4j.properties") + \
     " sqlline.SqlLine -d org.apache.phoenix.jdbc.PhoenixDriver \
 -u jdbc:phoenix:" + sys.argv[1] + \
-    " -n none -p none --color=true --fastConnect=false --verbose=true \
+    " -n none -p none --color=" + colorSetting + " --fastConnect=false --verbose=true \
 --isolation=TRANSACTION_READ_COMMITTED " + sqlfile
 
 subprocess.call(java_cmd, shell=True)


Mime
View raw message