astropy/astropy — pull request #688 by astrofrog (2013-01-28 21:12:17+00:00)
Title: Fix generate_default_config to work with affiliated packages

As reported in astropy/package-template#12, there is an issue with ``generate_default_config``, because the following lines:

```
pkg_dir = os.path.relpath(os.path.dirname(__file__))
config_path = os.path.join(pkg_dir, 'config')
filename = os.path.join(config_path, package + '.cfg')
```

mean that ``pkg_dir`` will point to the Astropy config path, not the affiliated package. I'm not sure what the best way to fix it is - @eteq @iguananaut, do you have any ideas? Should ``pgk_dir`` use the ``package`` variable instead? Also, note that affiliated packages do not have a ``config`` sub-package, so I guess the default configuration file should live at the root level. Actually, maybe we should just do that for the core package too, to simplify things?