Browse Source

- more setuptools magic

- move configuration to config files
 - default configuration in defaults.cfg
 - site configuration in gva.cfg


git-svn-id: file:///home/www/usr01/svn/gnuviechadmin/gnuviech.info/gnuviechadmin/trunk@221 a67ec6bc-e5d5-0310-a910-815c51eb3124
master
Jan Dittberner 15 years ago
parent
commit
3f099c72ff
  1. 14
      gnuviechadmin/defaults.cfg
  2. 25
      gnuviechadmin/gva.cfg.tmpl
  3. 14
      gnuviechadmin/tables.py
  4. 3
      setup.cfg
  5. 20
      setup.py

14
gnuviechadmin/Defaults.py → gnuviechadmin/defaults.cfg

@ -19,16 +19,16 @@
#
# Version: $Id$
"""Distributed default settings for significant GnuviechAdmin config
variables."""
# Distributed default settings for significant GnuviechAdmin config
# variables.
#
# NEVER make site configuration changes to this file. ALWAYS make
# them in gva_cfg.py instead, in the designated area. See the
# comments in that file for details.
# them in gva.cfg instead, in the designated area. See the comments
# in that file for details.
#----------------------------------------------------------------------
[database]
# The database connection string in a format usable for
# sqlalchemy. The default is an sqlite in memory database which is not
# very usable for a real installation.
#
GVA_DBE = 'sqlite:///:memory:'
uri = sqlite:///:memory:

25
gnuviechadmin/gva_cfg.py.tmpl → gnuviechadmin/gva.cfg.tmpl

@ -19,30 +19,9 @@
#
# Version: $Id$
"""This is the module which takes your site-specific settings.
From a raw distribution it should be copied to gva_cfg.py. If you
already have a gva_cfg.py, be careful to add in only the new settings
you want. The complete set of distributed defaults, with annotation,
are in ./Defaults. In mm_cfg, override only those you want to change,
after the
from Defaults import *
line (see below)."""
###############################################################
# Here's where we get the distributed defaults. #
from Defaults import *
###############################################################
# Put YOUR site-specific configuration below, in gva_cfg.py . #
# See Defaults.py for explanations of the values. #
#--------------------------------------------------------------
[database]
# The database connection string in a format usable for
# sqlalchemy. For examples see
# http://www.sqlalchemy.org/docs/dbengine.myt
#
GVA_DBE = 'sqlite:///database.txt'
uri = sqlite:///database.txt

14
gnuviechadmin/tables.py

@ -20,9 +20,19 @@
# Version: $Id$
from sqlalchemy import *
from gnuviechadmin import gva_cfg
from pkg_resources import Requirement, resource_filename
import ConfigParser, os
meta = BoundMetaData(gva_cfg.GVA_DBE)
config = ConfigParser.ConfigParser()
config.readfp(
open(resource_filename(Requirement.parse('gnuviechadmin'),
'gnuviechadmin/defaults.cfg')))
config.read([
resource_filename(Requirement.parse('gnuviechadmin'),
'gnuviechadmin/gva.cfg'),
os.path.expanduser('~/.gva.cfg')])
meta = BoundMetaData(config.get('database', 'uri'))
client_table = Table(
'client', meta,
Column('clientid', Integer, primary_key=True),

3
setup.cfg

@ -0,0 +1,3 @@
[egg_info]
tag_build = .dev
tag_svn_revision = 1

20
setup.py

@ -20,7 +20,7 @@
#
# Version: $Id$
from setuptools import setup,find_packages
from setuptools import setup, find_packages
try:
import buildutils
@ -30,15 +30,21 @@ except ImportError:
setup(
name = 'gnuviechadmin',
version = '0.1',
packages = find_packages(),
scripts = ['bin/createclient', 'bin/listclients'],
install_requires = ['sqlalchemy >= 0.3.0'],
setup_requires = [],
include_package_data = True,
exclude_package_data = { '' : ['gva.cfg'] },
author = 'Jan Dittberner',
author_email = 'jan@dittberner.info',
description = 'gnuviechadmin server administration suite',
long_description = """this is a suite of tools for administering a server
it contains tools for maintaining e.g. clients, domains, users, mail
accounts""",
author = 'Jan Dittberner',
author_email = 'jan@dittberner.info',
url = 'http://www.gnuviech-server.de/gnuviechadmin',
packages = ['gnuviechadmin'],
scripts = ['bin/createclient', 'bin/listclients'],
install_requires = ['sqlalchemy >= 0.3.0'],
license= 'GPL',
url = 'http://www.gnuviech-server.de/gnuviechadmin',
)

Loading…
Cancel
Save