Skip to content
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

Argparse2galaxy select field #46

Closed
anton-khodak opened this issue Apr 16, 2017 · 3 comments
Closed

Argparse2galaxy select field #46

anton-khodak opened this issue Apr 16, 2017 · 3 comments
Assignees

Comments

@anton-khodak
Copy link
Collaborator

The last issue that blocks successful travis checks is the resolving of default values in select fields.

example.py

...
parser.add_argument('--mode', choices=['rock', 'paper', 'scissors'], default='scissors')
...

In the example the default value is placed on the first place in the list of choices
example.xml

    <param argument="--mode" label="Author did not provide help for this parameter... " name="mode" optional="true" type="select">
      <option selected="true" value="scissors">scissors</option>
      <option value="paper">paper</option>
      <option value="rock">rock</option>
    </param>

The current version of argparse2tool resolves the default value in the order it appeared in argparse choices:

    <param argument="--mode" label="Author did not provide help for this parameter... " name="mode" optional="true" type="select">
      <option value="paper">paper</option>
      <option value="rock">rock</option>
      <option selected="true" value="scissors">scissors</option>
    </param>

If the behavior of the current version is correct than we should simple update example.xml.

@mr-c
Copy link
Collaborator

mr-c commented Apr 16, 2017

The latter is fine, yep!

@anton-khodak
Copy link
Collaborator Author

Fixed by 4740e40

@hexylena
Copy link
Owner

looks like a bug that they aren't sorted identically to the input. I'll file that for myself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants