Skip to content

Commit 3842ac7

Browse files
author
Richard Jones
committed
merge from HEAD
1 parent 262e99a commit 3842ac7

File tree

4 files changed

+30
-7
lines changed

4 files changed

+30
-7
lines changed

CHANGES.txt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Fixed:
1313
- fix setup.py to work with <Python2.3 (sf bug 1082801)
1414
- fix permissions checks in cgi templating (sf bug 1082755)
1515
- fix "Users may only edit their issues" example in docs
16+
- handle ~/.my.cnf files for MySQL defaults (sf bug 1096031)
1617

1718

1819
2004-12-08 0.8.0b1
@@ -61,7 +62,13 @@ Fixed:
6162
- demo tracker is always set up on localhost (sf bug 1049101)
6263

6364

64-
2004-10-06 0.7.11
65+
2004-??-?? 0.7.??
66+
Fixed:
67+
- handle capitalisation of class names in text hyperlinking (sf bug
68+
1101043)
69+
70+
71+
2005-01-06 0.7.11
6572
Fixed:
6673
- index args URL generation broken in .10 (sf bug 1096027)
6774
- handle NotModified for non-static files (sf patch 1095790)

roundup/backends/back_postgresql.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,15 @@
1414
from roundup import hyperdb, date
1515
from roundup.backends import rdbms_common
1616

17+
def connection_dict(config, dbnamestr=None):
18+
''' read_default_group is MySQL-specific, ignore it '''
19+
d = rdbms_common.connection_dict(config, dbnamestr)
20+
if d.has_key('read_default_group'):
21+
del d['read_default_group']
22+
if d.has_key('read_default_file'):
23+
del d['read_default_file']
24+
return d
25+
1726
def db_create(config):
1827
"""Clear all database contents and drop database itself"""
1928
command = 'CREATE DATABASE %s'%config.RDBMS_NAME
@@ -33,7 +42,7 @@ def db_command(config, command):
3342
'''Perform some sort of database-level command. Retry 10 times if we
3443
fail by conflicting with another user.
3544
'''
36-
template1 = rdbms_common.connection_dict(config)
45+
template1 = connection_dict(config)
3746
template1['database'] = 'template1'
3847

3948
try:
@@ -70,7 +79,7 @@ def pg_command(cursor, command):
7079

7180
def db_exists(config):
7281
"""Check if database already exists"""
73-
db = rdbms_common.connection_dict(config, 'database')
82+
db = connection_dict(config, 'database')
7483
try:
7584
conn = psycopg.connect(**db)
7685
conn.close()
@@ -85,7 +94,7 @@ class Database(rdbms_common.Database):
8594
implements_intersect = 1
8695

8796
def sql_open_connection(self):
88-
db = rdbms_common.connection_dict(self.config, 'database')
97+
db = connection_dict(self.config, 'database')
8998
self.config.logging.getLogger('hyperdb').info('open database %r'%(
9099
db['database'],))
91100
try:

roundup/backends/rdbms_common.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $Id: rdbms_common.py,v 1.142.2.2 2005-01-06 17:58:52 a1s Exp $
1+
# $Id: rdbms_common.py,v 1.142.2.3 2005-01-13 05:05:12 richard Exp $
22
''' Relational database (SQL) backend common code.
33
44
Basics:
@@ -68,7 +68,8 @@ def connection_dict(config, dbnamestr=None):
6868
d = { }
6969
if dbnamestr:
7070
d[dbnamestr] = config.RDBMS_NAME
71-
for name in 'host', 'port', 'password', 'user':
71+
for name in ('host', 'port', 'password', 'user', 'read_default_group',
72+
'read_default_file'):
7273
cvar = 'RDBMS_'+name.upper()
7374
if config[cvar] is not None:
7475
d[name] = config[cvar]

roundup/configuration.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Roundup Issue Tracker configuration support
22
#
3-
# $Id: configuration.py,v 1.23 2004-11-18 14:02:25 a1s Exp $
3+
# $Id: configuration.py,v 1.23.2.1 2005-01-13 05:05:11 richard Exp $
44
#
55
__docformat__ = "restructuredtext"
66

@@ -484,6 +484,12 @@ class NullableFilePathOption(NullableOption, FilePathOption):
484484
(NullableOption, 'password', 'roundup',
485485
"Database user password.",
486486
['MYSQL_DBPASSWORD']),
487+
(NullableOption, 'read_default_file', '~/.my.cnf',
488+
"Name of the MySQL defaults file.\n"
489+
"Only used in MySQL connections."),
490+
(NullableOption, 'read_default_group', 'roundup',
491+
"Name of the group to use in the MySQL defaults file (.my.cnf).\n"
492+
"Only used in MySQL connections."),
487493
), "Settings in this section are used"
488494
" by Postgresql and MySQL backends only"
489495
),

0 commit comments

Comments
 (0)