do "find the templates" identically to how sphinx does it

This commit is contained in:
Mike Bayer 2011-04-19 11:28:54 -04:00
parent 64e5d6c54f
commit 72269fbfa1
14 changed files with 4 additions and 4 deletions

View File

@ -1,4 +1,6 @@
from os import path
__version__ = '0.1alpha'
package_dir = path.abspath(path.dirname(__file__))

View File

@ -1,4 +1,4 @@
from alembic import command, util
from alembic import command, util, package_dir
from argparse import ArgumentParser
import ConfigParser
import inspect
@ -15,9 +15,7 @@ class Config(object):
return file_config
def get_template_directory(self):
# TODO: what's the official way to get at
# setuptools-installed datafiles ?
return os.path.join(os.path.dirname(__file__), '..', 'templates')
return os.path.join(package_dir, 'templates')
def get_section(self, name):
return dict(self.file_config.items(name))