1
0
Fork 0

r1085@denkpolster: jan | 2008-04-04 22:07:37 +0200

work on SQLite support (fixes #9)
  * correctly handle unicode output of SQLite (gpgmail.py)
  * only use schema for PostgreSQL databases (settings.py)
  * make SQLite and PostgreSQL mandatory (migrate.cfg)
  * add SQLite SQL to database version 1 of dbrepo


git-svn-id: file:///home/www/usr01/svn/gnuviechadmin/trunk@249 a67ec6bc-e5d5-0310-a910-815c51eb3124
This commit is contained in:
Jan Dittberner 2008-04-04 20:07:39 +00:00
parent 4ae866c559
commit cccc6b8fe3
5 changed files with 11 additions and 4 deletions

View File

@ -17,4 +17,4 @@ version_table=migrate_version
# entire commit will fail. List the databases your application will actually
# be using to ensure your updates to that database work properly.
# This must be a list; example: ['postgres','sqlite']
required_dbs=[]
required_dbs=['postgres', 'sqlite']

View File

@ -1,3 +1,4 @@
# -*- python -*-
# -*- coding: utf-8 -*-
#
# Copyright (C) 2007, 2008 by Jan Dittberner.
@ -23,13 +24,16 @@ import ConfigParser, os, string, logging.config
# global settings which must not be user configurable
required_version = 3
dbschema = 'gva'
# load user configuration
config = ConfigParser.ConfigParser()
config.readfp(open('gnuviechadmin/defaults.cfg'))
config.read(['gnuviechadmin/gva.cfg', os.path.expanduser('~/.gva.cfg')])
dbschema = None
if config.get('database', 'uri').startswith('postgres://'):
dbschema = 'gva'
def get_template_dir(dirname):
"""Returns the template directory for the given directory."""
templatepath = config.get('common', 'templatedir')

View File

@ -1,6 +1,7 @@
# -*- coding: UTF-8 -*-
# -*- python -*-
# -*- coding: utf-8 -*-
#
# Copyright (C) 2007 by Jan Dittberner.
# Copyright (C) 2007, 2008 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
@ -30,6 +31,8 @@ def send_mail(subject, text):
"""This method sends a mail with the given text and subject
and signs it usign GnuPG. If a public key of the recipient is
available the mail is encrypted."""
if not text.__class__.__name__ == 'str':
text = text.encode('ascii', 'replace')
plain = core.Data(text)
cipher = core.Data()
c = core.Context()