1
0
Çatalla 0

move config initialisation to gnuviechadmin.config

* data/dbrepo/versions/002.py use gnuviechadmin.config to read config
   (fixes #37)
 * move config initialization out of bin/gva to make it usable elsewhere
 * add config.py to egg-info
Bu işleme şunda yer alıyor:
Jan Dittberner 2009-08-02 20:51:24 +02:00
ebeveyn 06e1e11a61
işleme 33696436a0
6 değiştirilmiş dosya ile 50 ekleme ve 16 silme

14
bin/gva
Dosyayı Görüntüle

@ -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()

Dosyayı Görüntüle

@ -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(

Dosyayı Görüntüle

@ -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)

Dosyayı Görüntüle

@ -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

Dosyayı Görüntüle

@ -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

37
gnuviechadmin/config.py Normal dosya
Dosyayı Görüntüle

@ -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)