Motivated by this comment:
https://github.com/enthought/traitsui/pull/1684/files#r655198812
See relevant code block here:
|
def string_value(self, value, format_func=None): |
|
""" Returns the text representation of a specified object trait value. |
|
|
|
If the **format_func** attribute is set on the editor factory, then |
|
this method calls that function to do the formatting. If the |
|
**format_str** attribute is set on the editor factory, then this |
|
method uses that string for formatting. If neither attribute is |
|
set, then this method just calls the appropriate text type to format. |
|
""" |
|
if self.format_func is not None: |
|
return self.format_func(value) |
|
|
|
if self.format_str != "": |
|
return self.format_str % value |
|
|
|
if format_func is not None: |
|
return format_func(value) |
|
|
|
return str(value) |
The docstring does not mention the format_func kwarg, and it seems strange that one can pass a format_func kwarg explicitly and have it go unused if the factory has its format_func or format_str traits set.
Motivated by this comment:
https://github.com/enthought/traitsui/pull/1684/files#r655198812
See relevant code block here:
traitsui/traitsui/editor_factory.py
Lines 190 to 208 in 190b683
The docstring does not mention the
format_funckwarg, and it seems strange that one can pass aformat_funckwarg explicitly and have it go unused if the factory has itsformat_funcorformat_strtraits set.