MCPcopy
hub / github.com/donnemartin/saws / set_color

Method set_color

saws/saws.py:120–133  ·  view source on GitHub ↗

Setter for color output mode. Used by prompt_toolkit's KeyBindingManager. KeyBindingManager expects this function to be callable so we can't use @property and @attrib.setter. Args: * color: A boolean that represents the color flag. Returns:

(self, color)

Source from the content-addressed store, hash-verified

118 click.secho(str(e), fg='red')
119
120 def set_color(self, color):
121 """Setter for color output mode.
122
123 Used by prompt_toolkit's KeyBindingManager.
124 KeyBindingManager expects this function to be callable so we can't use
125 @property and @attrib.setter.
126
127 Args:
128 * color: A boolean that represents the color flag.
129
130 Returns:
131 None.
132 """
133 self.config_obj[self.config.MAIN][self.config.COLOR] = color
134
135 def get_color(self):
136 """Getter for color output mode.

Callers 5

test_toolbar_onMethod · 0.80
test_toolbar_offMethod · 0.80
test_set_get_colorMethod · 0.80
test_colorize_outputMethod · 0.80
test_process_commandMethod · 0.80

Calls

no outgoing calls

Tested by 5

test_toolbar_onMethod · 0.64
test_toolbar_offMethod · 0.64
test_set_get_colorMethod · 0.64
test_colorize_outputMethod · 0.64
test_process_commandMethod · 0.64