audreyr/cookiecutter — pull request #31 by raphigaziano (2013-08-18 15:02:14+00:00)
Title: Config

Hi, i started working on handling a global configuration file. I've settled for a json format, as it should be easy to use and prove consistent with the template's individual config file.

I wrote a couple of helpers to allow comments in the json file - might not be terribly useful, but could help having a more user friendly format. Global configuration is read when generating the context and updated with any values defined by the current template, and an empty one is created if it doesn't already exists (I'm thinking we could prompt the user for the values it will hold).

I've included a "template_dirs" value, which isn't used at all at the moment, but could point to some directory holding local templates, as suggested in issue #25.

I could only test it under linux, and under 2.7 (tried to use tox and watched it crash - I'll need to figure out how this works). Hope nothing breaks in other versions.

Still a work in progress but hopefully might inspire more ideas.