From 22099addaf6029656f8927ffb894c86c73bfaceb Mon Sep 17 00:00:00 2001 From: Philip Thompson Date: Tue, 6 Oct 2015 15:30:26 -0400 Subject: [PATCH] Cleanup whitespace for cqlsh PEP8 compliance patch by philipthompson; reviewed by Stefania for CASSANDRA-10455 --- bin/cqlsh.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bin/cqlsh.py b/bin/cqlsh.py index 46210dad10..56b709f9a4 100644 --- a/bin/cqlsh.py +++ b/bin/cqlsh.py @@ -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)