-
Notifications
You must be signed in to change notification settings - Fork 100
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
Add append/remove subcommands to bin/omero config
#1905
Conversation
append = parser.add( | ||
sub, self.append, "Append value to a key in the current profile.") | ||
remove = parser.add( | ||
sub, self.remove, "Append value to a key in the current profile.") |
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.
Should say "remove" instead of "append"
Last commits should fix the help/descriptions across all
|
load.set_defaults(func=self.load) | ||
load = parser.add( | ||
sub, self.load, | ||
"Read into current profile from a file or standard in") |
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.
"standard input" perhaps, may as well expand both if at all
@knabar : do you want to take an initial look at this? |
Types are handled inconsistently:
Should values passed to |
@knabar: agreed. There is a discrepancy between
to be correctly interpreted. I will add commits to unify the behaviour with the existing |
Values passed to
|
With the latest change, I now have
|
Works as expected now.
|
OK here's the next question for you @knabar
Are we expecting |
Two issues here:
|
It depends on whether we're going to change the handling of default values in future.
So at present if I want to add omero_searcher to |
Going to |
Note at the moment, appending to an unset value is possible as I thought the following would be not ideal:
But I can revert this possibility if that's the general consensus. @will-moore: any strong feeling about the last removal discussion? If you are okay with @manics and @knabar, I can push an extra commit that sets |
Hmmm, good point. I guess the ideal situation would be for |
I want to test this myself, but haven't had time to build latest server yet...
|
I think that removing the last item should give you an empty list (not unset).
So this would be different from the 'appending to unset value' that we have now. |
I've wondered if we don't want to "extend" the |
👍 Would make web configuration a lot easier. |
- Update corresponding unit tests - Add test for removal of multi-defined item
Sorry, previous comment was a misunderstanding. This was "No JSON object" when setting 'a'. |
@joshmoore It should probably still go to an empty list. If you remove all the default elements one by one, it would be counter-intuitive if they pop all back up once the last element is removed. |
Seconding @knabar's answer. Arguably, we could simply extend Andrea's |
Closing in favour of #2030 |
This PR addresses https://trac.openmicroscopy.org.uk/ome/ticket/11201
Changes included are:
addition of
bin/omero config append
andbin/omero config remove
so that configuration using lists of strings can easily be manipulated, e.g.addition of corresponding unit tests under
test_prefs.py
/cc @dpwrussell, @will-moore, @manics