diff --git a/bin/gva b/bin/gva index cf082ce..4856b53 100755 --- a/bin/gva +++ b/bin/gva @@ -21,20 +21,8 @@ # # Version: $Id$ -from paste.deploy import appconfig from sys import argv -from os import getcwd -from os.path import isfile -from logging.config import fileConfig +from gnuviechadmin.config import config from gnuviechadmin.cli import CommandLineInterface -if len(argv) > 1 and isfile(argv[1]): - configfile = argv[1] - del argv[1] -else: - configfile = 'development.ini' - -config = appconfig('config:%s' % configfile, relative_to=getcwd()) -fileConfig(configfile, config) - CommandLineInterface(config, argv).run() diff --git a/data/dbrepo/versions/002.py b/data/dbrepo/versions/002.py index dfcb66f..2988d38 100644 --- a/data/dbrepo/versions/002.py +++ b/data/dbrepo/versions/002.py @@ -1,6 +1,10 @@ from sqlalchemy import * from migrate import * -from gnuviechadmin.backend.settings import dbschema +from gnuviechadmin.config import config + +dbschema = None +if 'database.schema' in config: + dbschema = config['database.schema'] meta = MetaData(migrate_engine) client = Table( diff --git a/data/dbrepo/versions/003.py b/data/dbrepo/versions/003.py index 15f50c7..cff60c6 100644 --- a/data/dbrepo/versions/003.py +++ b/data/dbrepo/versions/003.py @@ -1,6 +1,10 @@ from sqlalchemy import * from migrate import * -from gnuviechadmin.backend.settings import dbschema +from gnuviechadmin.config import config + +dbschema = None +if 'database.schema' in config: + dbschema = config['database.schema'] meta = MetaData(migrate_engine) domain = Table('domain', meta, schema = dbschema, autoload = True) diff --git a/gnuviechadmin.egg-info/PKG-INFO b/gnuviechadmin.egg-info/PKG-INFO index acf0a59..0ea3c6e 100644 --- a/gnuviechadmin.egg-info/PKG-INFO +++ b/gnuviechadmin.egg-info/PKG-INFO @@ -1,6 +1,6 @@ Metadata-Version: 1.0 Name: gnuviechadmin -Version: 0.1.dev-20090730 +Version: 0.1.dev-20090802 Summary: gnuviechadmin server administration suite Home-page: http://www.gnuviech-server.de/projects/gnuviechadmin Author: Jan Dittberner diff --git a/gnuviechadmin.egg-info/SOURCES.txt b/gnuviechadmin.egg-info/SOURCES.txt index 7070188..702761d 100644 --- a/gnuviechadmin.egg-info/SOURCES.txt +++ b/gnuviechadmin.egg-info/SOURCES.txt @@ -3,6 +3,7 @@ setup.py bin/gva bin/gvaserver gnuviechadmin/__init__.py +gnuviechadmin/config.py gnuviechadmin/exceptions.py gnuviechadmin.egg-info/PKG-INFO gnuviechadmin.egg-info/SOURCES.txt diff --git a/gnuviechadmin/config.py b/gnuviechadmin/config.py new file mode 100644 index 0000000..8738dc9 --- /dev/null +++ b/gnuviechadmin/config.py @@ -0,0 +1,37 @@ +#!/usr/bin/env python +# -*- python -*- +# -*- coding: utf-8 -*- +# +# Copyright (C) 2009 by Jan Dittberner. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +# USA. +# +# Version: $Id$ + +from sys import argv +from os import getcwd +from os.path import isfile +from paste.deploy import appconfig +from logging.config import fileConfig + +if len(argv) > 1 and isfile(argv[1]): + configfile = argv[1] + del argv[1] +else: + configfile = 'development.ini' + +config = appconfig('config:%s' % configfile, relative_to=getcwd()) +fileConfig(configfile, config)