pivotal_tools
pivotal_tools copied to clipboard
Passing --project-index to show_story gives list index out of range
When I pass --project-index to show_story, I get error displayed below. Without specifying this option, it works as expected.
I've installed to a virtualenv, with pip install. Running on Ubuntu 12.10 (server), Python 2.7.3
$ pivotal_tools show_story 12345678 --project-index=12345
Traceback (most recent call last):
File "~/bin/pivotal_tools", line 8, in <module>
load_entry_point('pivotal-tools==0.13', 'console_scripts', 'pivotal_tools')()
File "~/local/lib/python2.7/site-packages/pivotal_tools/cli.py", line 487, in main
show_story(arguments['<story_id>'], arguments)
File "~/local/lib/python2.7/site-packages/pivotal_tools/cli.py", line 172, in show_story
story = load_story(story_id, arguments)
File "~/local/lib/python2.7/site-packages/pivotal_tools/cli.py", line 245, in load_story
story = Story.find(story_id, project_index=idx)
File "~/local/lib/python2.7/site-packages/pivotal_tools/pivotal.py", line 78, in find
project = Project.all()[project_index]
IndexError: list index out of range
Hi @wkoot,
So project-index != project-id. I should have been more explict in my docs. And handle the index error.
But if you do a:
pivotal_tools show_stories
if you have have multiple projects it will list them like so:
- first project
- second project
^---- that number is the number I am using for index
Also -- for show story you do not have to pass the project-index. It will find the story for you
I'm only linked to one project, but the docs suggest passing the project_index since it'd be quicker :-)
Also, pivotal_tools show_stories --project-index=12345
works just fine for me?
Indeed if I use --project-index=1
with show_story, it returns without problems.
How would I know the project index number when I have multiple projects though?
Is it based on Pivotal's project-id (eg. lowest project-id has index 1, and so on)?