lib/parser: Use a function to get num of items in a tuple#5506
Draft
wenzeslaus wants to merge 1 commit intoOSGeo:mainfrom
Draft
lib/parser: Use a function to get num of items in a tuple#5506wenzeslaus wants to merge 1 commit intoOSGeo:mainfrom
wenzeslaus wants to merge 1 commit intoOSGeo:mainfrom
Conversation
This uses a function to get the required number of items in a tuple if the parameter value is defined as a tuple using key_desc. This is a first step to providing this information in the API and tool metadata which is important because it has implications for type (tool option parameter of type int with key_desc with comma has to have the comma, so it is actually not an int in e.g. Python). There is little more what can be done here and that's not doing the check when there is no tuple, but this would be better done with some tests in place for this parser feature. The function is actually already in OSGeo#5490 so this is a draft also for this reason, but the logic should be reviewable.
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.
This uses a function to get the required number of items in a tuple if the parameter value is defined as a tuple using key_desc. This is a first step to providing this information in the API and tool metadata which is important because it has implications for type (tool option parameter of type int with key_desc with comma has to have the comma, so it is actually not an int in e.g. Python).
There is little more what can be done here and that's not doing the check when there is no tuple, but this would be better done with some tests in place for this parser feature.
The function is actually already in #5490 so this is a draft also for this reason, but the logic should be reviewable.