xanthics/gw2craft — pull request #9 by mattdeboard (2013-06-02 23:15:15+00:00)
Title: Refactor create_recipes.py.

1. Replace tabs with spaces (4)

2. Refactor & simplify logic in parse_recipes. I am sure I'm missing a case here but I think I covered MOST of the logic by filtering the data earlier using list comprehensions.

3. Factor the API calls out into a separate function, ``_api_call``.

4. Use built-in ``enumerate`` when iterating instead of manually keeping a counter

5. Break up super mega huge lines

6. Rename some variables to be more clear. ``re`` isn't a great variable name for example since that's the name of Python's built-in regex module. I didn't rename EVERY variable though.