Skip to content

lib/parser: Use a function to get num of items in a tuple#5506

Draft
wenzeslaus wants to merge 1 commit intoOSGeo:mainfrom
wenzeslaus:parser-use-function-to-define-tuple
Draft

lib/parser: Use a function to get num of items in a tuple#5506
wenzeslaus wants to merge 1 commit intoOSGeo:mainfrom
wenzeslaus:parser-use-function-to-define-tuple

Conversation

@wenzeslaus
Copy link
Copy Markdown
Member

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.

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.
@github-actions github-actions bot added C Related code is in C libraries labels Apr 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C Related code is in C libraries

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant