-
Notifications
You must be signed in to change notification settings - Fork 124
Updated set command to support tab completion of values #873
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…ed complete_set_value() to pass all tokens into its AutoCompleter
…as well as something resembling an argparse flag (e.g. -h)
Codecov Report
@@ Coverage Diff @@
## master #873 +/- ##
==========================================
+ Coverage 97.37% 97.39% +0.01%
==========================================
Files 14 14
Lines 3580 3602 +22
==========================================
+ Hits 3486 3508 +22
Misses 94 94 Continue to review full report at Codecov.
|
Documented Settable.onchange_cb
tleonhardt
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good
|
This all looks pretty good to me. I'll add one suggestion. If the list of valid values is not known at initialization time (which is when settables would typically get defined), you have to do really awkward stuff in order to validate the new value of a setting when a user changes it. The If I somehow manage to say the input isn't valid, there is no way for my callback to to say "hey this isn't a valid value, I don't want to allow the user to change it" back to |
|
@kotfu The onchange_cb = self.val_changedAs far as validation, that's the job of |
|
Go it. I missed that |
|
@kotfu I update the docstring for |
|
hold up before we merge this, I need to fix the settings.rst documentation and update examples/environment.py |
|
This looks good so I'm going to merge it |
Closes #870 #871