File tree Expand file tree Collapse file tree 3 files changed +12
-11
lines changed Expand file tree Collapse file tree 3 files changed +12
-11
lines changed Original file line number Diff line number Diff line change
1
+ ## 2.5.5 (TBD)
2
+ * Bug Fixes
3
+ * Fixed type hints for passing a class method to ` with_argparser ` and ` as_subcommand_to ` .
4
+ * Fixed issue where ` set ` command was not always printing a settable's current value.
5
+
1
6
## 2.5.4 (November 6, 2024)
2
7
* Bug Fixes
3
8
* Fixed ` ZeroDivisionError ` in ` async_alert() ` when ` shutil.get_terminal_size().columns ` is 0.
Original file line number Diff line number Diff line change @@ -4226,11 +4226,11 @@ def do_set(self, args: argparse.Namespace) -> None:
4226
4226
# Try to update the settable's value
4227
4227
try :
4228
4228
orig_value = settable .get_value ()
4229
- new_value = settable .set_value (utils .strip_quotes (args .value ))
4229
+ settable .set_value (utils .strip_quotes (args .value ))
4230
4230
except Exception as ex :
4231
4231
self .perror (f"Error setting { args .param } : { ex } " )
4232
4232
else :
4233
- self .poutput (f"{ args .param } - was: { orig_value !r} \n now: { new_value !r} " )
4233
+ self .poutput (f"{ args .param } - was: { orig_value !r} \n now: { settable . get_value () !r} " )
4234
4234
self .last_result = True
4235
4235
return
4236
4236
Original file line number Diff line number Diff line change @@ -178,17 +178,14 @@ def get_bool_choices(_) -> List[str]: # type: ignore[no-untyped-def]
178
178
self .completer = completer
179
179
180
180
def get_value (self ) -> Any :
181
- """
182
- Get the value of the settable attribute
183
- :return:
184
- """
181
+ """Get the value of the settable attribute."""
185
182
return getattr (self .settable_obj , self .settable_attrib_name )
186
183
187
- def set_value (self , value : Any ) -> Any :
184
+ def set_value (self , value : Any ) -> None :
188
185
"""
189
- Set the settable attribute on the specified destination object
190
- :param value: New value to set
191
- :return: New value that the attribute was set to
186
+ Set the settable attribute on the specified destination object.
187
+
188
+ :param value: new value to set
192
189
"""
193
190
# Run the value through its type function to handle any conversion or validation
194
191
new_value = self .val_type (value )
@@ -205,7 +202,6 @@ def set_value(self, value: Any) -> Any:
205
202
# Check if we need to call an onchange callback
206
203
if orig_value != new_value and self .onchange_cb :
207
204
self .onchange_cb (self .name , orig_value , new_value )
208
- return new_value
209
205
210
206
211
207
def is_text_file (file_path : str ) -> bool :
You can’t perform that action at this time.
0 commit comments