]> git.ipfire.org Git - thirdparty/sqlalchemy/alembic.git/commitdiff
do "find the templates" identically to how sphinx does it
authorMike Bayer <mike_mp@zzzcomputing.com>
Tue, 19 Apr 2011 15:28:54 +0000 (11:28 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Tue, 19 Apr 2011 15:28:54 +0000 (11:28 -0400)
14 files changed:
alembic/__init__.py
alembic/config.py
alembic/templates/generic/README [moved from templates/generic/README with 100% similarity]
alembic/templates/generic/alembic.ini.mako [moved from templates/generic/alembic.ini.mako with 100% similarity]
alembic/templates/generic/env.py [moved from templates/generic/env.py with 100% similarity]
alembic/templates/generic/script.py.mako [moved from templates/generic/script.py.mako with 100% similarity]
alembic/templates/multidb/README [moved from templates/multidb/README with 100% similarity]
alembic/templates/multidb/alembic.ini.mako [moved from templates/multidb/alembic.ini.mako with 100% similarity]
alembic/templates/multidb/env.py [moved from templates/multidb/env.py with 100% similarity]
alembic/templates/multidb/script.py.mako [moved from templates/multidb/script.py.mako with 100% similarity]
alembic/templates/pylons/README [moved from templates/pylons/README with 100% similarity]
alembic/templates/pylons/alembic.ini.mako [moved from templates/pylons/alembic.ini.mako with 100% similarity]
alembic/templates/pylons/env.py [moved from templates/pylons/env.py with 100% similarity]
alembic/templates/pylons/script.py.mako [moved from templates/pylons/script.py.mako with 100% similarity]

index f18873da977065b24686858677445f031eab543e..9c52e029ed98f241714b520e6bc53eec5bcd4bf2 100644 (file)
@@ -1,4 +1,6 @@
+from os import path
 
 __version__ = '0.1alpha'
 
+package_dir = path.abspath(path.dirname(__file__))
 
index e713b0475c0d4a00f0697b6b21d89be6258296c9..a8c261483d8cbcad3e21c16e23371e2d479952f0 100644 (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))