nickjj/ansigenome

License type out of range when first time setup is ran

garlandkr opened this issue · 4 comments

Pick a license type by choosing a number:

  1. MIT
  2. GPLv2
  3. GPLv3
  5. LGPL
  6. Apache-2.0
  7. BSDv2
  8. BSDv3
  9. Other

 []: 9
Traceback (most recent call last):
  File "/usr/local/bin/ansigenome", line 6, in <module>
    exec(compile(open(__file__).read(), __file__, 'exec'))
  File "/Users/kgarland/Code/ansigenome/bin/ansigenome", line 326, in <module>
    main()
  File "/Users/kgarland/Code/ansigenome/bin/ansigenome", line 309, in main
    (config, config_path) = load_config()
  File "/Users/kgarland/Code/ansigenome/bin/ansigenome", line 248, in load_config
    Config([], {}, {})
  File "/Users/kgarland/Code/ansigenome/ansigenome/config.py", line 28, in __init__
    out_config = self.ask_questions()
  File "/Users/kgarland/Code/ansigenome/ansigenome/config.py", line 77, in ask_questions
    out_config["license_type"] = c.LICENSE_TYPES[answer][0]
IndexError: list index out of range

I can't reproduce this on my end. I deleted my config and let Ansigenome create a new one by running ansigenome config. What did you enter as the license type and what version of Python are you running?

I was able to successfully perform these actions:

  • Pick a license using a number between 1-8
  • Pick an invalid license by entering something like 42
    • In which case Ansigenome re-prompts me to pick a valid license
  • Pick an invalid license by entering nothing
    • In which case Ansigenome re-prompts me to pick a valid license
  • Pick an invalid license by entering a non-numeric value
    • In which case Ansigenome re-prompts me to pick a valid license

I chose option 9, I edited my original comment. Markdown didn't like having empty brackets (I just copy/pasted from cli.)

Python - 2.7.6

Ok, confirmed. Thanks, I'll fix this for the next release.