Cleanup whitespace for cqlsh PEP8 compliance

patch by philipthompson; reviewed by Stefania for CASSANDRA-10455
This commit is contained in:
Philip Thompson 2015-10-06 15:30:26 -04:00 committed by Sylvain Lebresne
parent 2084f3fb19
commit 22099addaf
1 changed files with 4 additions and 2 deletions

View File

@ -2554,9 +2554,10 @@ class SwitchCommand(object):
print 'Disabled %s.' % (self.description,)
return False
class SwitchCommandWithValue(SwitchCommand):
"""The same as SwitchCommand except it also accepts a value in place of ON.
This returns a tuple of the form: (SWITCH_VALUE, PASSED_VALUE)
eg: PAGING 50 returns (True, 50)
PAGING OFF returns (False, None)
@ -2567,7 +2568,7 @@ class SwitchCommandWithValue(SwitchCommand):
def __init__(self, command, desc, value_type=int):
SwitchCommand.__init__(self, command, desc)
self.value_type = value_type
def execute(self, state, parsed, printerr):
binary_switch_value = SwitchCommand.execute(self, state, parsed, printerr)
switch = parsed.get_binding('switch')
@ -2578,6 +2579,7 @@ class SwitchCommandWithValue(SwitchCommand):
value = None
return (binary_switch_value, value)
def option_with_default(cparser_getter, section, option, default=None):
try:
return cparser_getter(section, option)