mirror of https://github.com/apache/cassandra
Merge branch 'cassandra-2.2' into trunk
This commit is contained in:
commit
1f5c4f7ba5
|
|
@ -945,7 +945,7 @@ class Shell(cmd.Cmd):
|
|||
try:
|
||||
import readline
|
||||
except ImportError:
|
||||
if platform.system() == 'Windows':
|
||||
if myplatform == 'Windows':
|
||||
print "WARNING: pyreadline dependency missing. Install to enable tab completion."
|
||||
pass
|
||||
else:
|
||||
|
|
|
|||
|
|
@ -23,8 +23,11 @@ call cassandra.in.bat
|
|||
if NOT DEFINED CASSANDRA_HOME set CASSANDRA_HOME=%~dp0..
|
||||
if NOT DEFINED JAVA_HOME goto :err
|
||||
|
||||
set CASSANDRA_PARAMS=%CASSANDRA_PARAMS% -Dcassandra.logdir="%CASSANDRA_HOME%\logs"
|
||||
set CASSANDRA_PARAMS=%CASSANDRA_PARAMS% -Dcassandra.storagedir="%CASSANDRA_HOME%\data"
|
||||
|
||||
echo Starting NodeTool
|
||||
"%JAVA_HOME%\bin\java" -cp %CASSANDRA_CLASSPATH% -Dlogback.configurationFile=logback-tools.xml org.apache.cassandra.tools.NodeTool %*
|
||||
"%JAVA_HOME%\bin\java" -cp %CASSANDRA_CLASSPATH% %CASSANDRA_PARAMS% -Dlogback.configurationFile=logback-tools.xml org.apache.cassandra.tools.NodeTool %*
|
||||
goto finally
|
||||
|
||||
:err
|
||||
|
|
|
|||
|
|
@ -16,16 +16,20 @@
|
|||
|
||||
import calendar
|
||||
import math
|
||||
import platform
|
||||
import re
|
||||
import sys
|
||||
import platform
|
||||
import time
|
||||
from collections import defaultdict
|
||||
|
||||
from . import wcwidth
|
||||
from .displaying import colorme, FormattedValue, DEFAULT_VALUE_COLORS
|
||||
from datetime import datetime, timedelta
|
||||
from cassandra.cqltypes import EMPTY
|
||||
|
||||
is_win = platform.system() == 'Windows'
|
||||
|
||||
unicode_controlchars_re = re.compile(r'[\x00-\x31\x7f-\xa0]')
|
||||
controlchars_re = re.compile(r'[\x00-\x31\x7f-\xff]')
|
||||
|
||||
|
|
@ -193,15 +197,24 @@ def strftime(time_format, seconds):
|
|||
offset = -time.altzone
|
||||
else:
|
||||
offset = -time.timezone
|
||||
if formatted[-4:] != '0000' or time_format[-2:] != '%z' or offset == 0:
|
||||
if not is_win and (formatted[-4:] != '0000' or time_format[-2:] != '%z' or offset == 0):
|
||||
return formatted
|
||||
elif is_win and time_format[-2:] != '%z':
|
||||
return formatted
|
||||
|
||||
# deal with %z on platforms where it isn't supported. see CASSANDRA-4746.
|
||||
if offset < 0:
|
||||
sign = '-'
|
||||
else:
|
||||
sign = '+'
|
||||
hours, minutes = divmod(abs(offset) / 60, 60)
|
||||
return formatted[:-5] + sign + '{0:0=2}{1:0=2}'.format(hours, minutes)
|
||||
# Need to strip out invalid %z output on Windows. C libs give us 'Eastern Standard Time' instead of +/- GMT
|
||||
if is_win and time_format[-2:] == '%z':
|
||||
# Remove chars and strip trailing spaces left behind
|
||||
formatted = re.sub('[A-Za-z]', '', formatted).rstrip()
|
||||
return formatted + sign + '{0:0=2}{1:0=2}'.format(hours, minutes)
|
||||
else:
|
||||
return formatted[:-5] + sign + '{0:0=2}{1:0=2}'.format(hours, minutes)
|
||||
|
||||
@formatter_for('Date')
|
||||
def format_value_date(val, colormap, **_):
|
||||
|
|
|
|||
Loading…
Reference in New Issue