1
0
Fork 0

add PasteDeploy dependency, remove pudge dependency

* upgrade migrate repository structure (fixes #32, #27)
 * switch to PasteDeploy (fixes #31)
 * update for SQLAlchemy 0.5 compatibility
 * add python-gnutls dependency (addresses #35)
This commit is contained in:
Jan Dittberner 2009-07-19 01:03:23 +02:00
parent 483c1f9038
commit 222b35b033
24 changed files with 247 additions and 177 deletions

50
bin/gva
View file

@ -21,42 +21,20 @@
#
# Version: $Id$
import gnuviechadmin.cli.client
import gnuviechadmin.cli.sysuser
import gnuviechadmin.cli.domain
import gnuviechadmin.cli.record
import sys, os, logging.config
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.cli import CommandLineInterface
logcfgs = ('gnuviechadmin/logging.cfg', '/etc/gnuviechadmin/logging.cfg',
os.path.expanduser('~/.gva-logging.cfg'))
for cfg in [x for x in logcfgs if os.path.exists(x)]:
logging.config.fileConfig(cfg)
if len(argv) > 1 and isfile(argv[1]):
configfile = argv[1]
del argv[1]
else:
configfile = 'development.ini'
commands = [gnuviechadmin.cli.client.ClientCli,
gnuviechadmin.cli.sysuser.SysuserCli,
gnuviechadmin.cli.domain.DomainCli,
gnuviechadmin.cli.record.RecordCli]
config = appconfig('config:%s' % configfile, relative_to=getcwd())
fileConfig(configfile, config)
def usage():
print """%s <command> [commandargs]
where command is one of
""" % sys.argv[0]
for command in commands:
print "%10s - %s" % (command.name, command.description)
def main():
if (sys.argv.__len__() < 2):
usage()
sys.exit()
command = sys.argv[1]
commargs = sys.argv[2:]
if command in [cmd.name for cmd in commands]:
for cmd in commands:
if cmd.name == command:
cmd(commargs)
else:
usage()
if __name__ == '__main__':
main()
CommandLineInterface(config, argv).run()