[v7r2 --> v7r3(#5035)] register script arguments#5024
Closed
TaykYoku wants to merge 14 commits into
Closed
Conversation
andresailer
requested changes
Mar 9, 2021
andresailer
left a comment
Contributor
There was a problem hiding this comment.
This is a cool thing, but it is still optional to use registerArgument, right?
Also pylint spotted some errors
| # Check arguments | ||
| lenDefinedArgs = len(self.commandArgList) | ||
| lenRegistredArgs = len(self.commandArgumentList) | ||
| for i in range(lenRegistredArgs): |
Contributor
Author
|
@andresailer yes, it's optional to use, I added it everywhere to make the scripts more standard.. but if it's a bad idea, I can only leave it as an example script. |
Contributor
|
@TaykYoku No, you can leave it in, I just wanted to be sure I understood that this is indeed optional for all the other scripts out there |
6eeddee to
3c28b4b
Compare
andresailer
reviewed
Mar 15, 2021
| return localCfg.getPositionalArguments() | ||
| def registerArgument(description, mandatory=True, acceptedValues=None, default=None): | ||
| """ Register a new command line argument | ||
|
|
Contributor
There was a problem hiding this comment.
Point to the registerCmdArg function. Something like (I think)
Suggested change
| See :func:`~DIRAC.ConfigurationSystem.Client.LocalConfiguration.LocalConfiguration.registerCmdArg` for the syntax of the ``description`` parameter. | |
TaykYoku
added a commit
to TaykYoku/DIRAC
that referenced
this pull request
Mar 17, 2021
TaykYoku
added a commit
to TaykYoku/DIRAC
that referenced
this pull request
Mar 17, 2021
TaykYoku
added a commit
to TaykYoku/DIRAC
that referenced
this pull request
Mar 17, 2021
TaykYoku
added a commit
to TaykYoku/DIRAC
that referenced
this pull request
Mar 17, 2021
Contributor
|
Will be treated separately. |
TaykYoku
added a commit
to TaykYoku/DIRAC
that referenced
this pull request
Jul 10, 2021
TaykYoku
added a commit
to TaykYoku/DIRAC
that referenced
this pull request
Jul 15, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
BEGINRELEASENOTES
As continuation of #4958.
Added the ability to register positional arguments and add it to help message.
Scripts with positional arguments that I didn't touch:
*All systems affected:
CHANGE: use
registerArgumentto register positional arguments for scripts*Core:
CHANGE: Added the ability to register positional arguments
*Configuration:
CHANGE: Added the ability to register positional arguments
ENDRELEASENOTES