~ubuntu-branches/ubuntu/precise/trac/precise

« back to all changes in this revision

Viewing changes to trac/db/api.py

  • Committer: Bazaar Package Importer
  • Author(s): Luis Matos
  • Date: 2007-05-20 22:46:56 UTC
  • mfrom: (1.1.12 upstream)
  • Revision ID: james.westby@ubuntu.com-20070520224656-3g5unjo0c4glevjh
Tags: 0.10.4-1
* New upstream release (Closes: #414134, #420219)
* Fixed typo in debian/copyright file (Closes: #422409)

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
from trac.config import Option, IntOption
21
21
from trac.core import *
22
22
from trac.db.pool import ConnectionPool
 
23
from trac.util.text import unicode_passwd
23
24
 
24
25
 
25
26
def get_column_names(cursor):
93
94
                    candidates[scheme] = (connector, priority)
94
95
            connector = candidates.get(scheme, [None])[0]
95
96
        if not connector:
96
 
            raise TracError, 'Unsupported database type "%s"' % scheme
 
97
            raise TracError('Unsupported database type "%s"' % scheme)
97
98
 
98
99
        if scheme == 'sqlite':
99
100
            # Special case for SQLite to support a path relative to the
115
116
            host = None
116
117
            path = rest
117
118
        else:
118
 
            raise TracError, 'Database connection string %s must start with ' \
119
 
                             'scheme:/' % db_str
 
119
            raise TracError('Database connection string must start with '
 
120
                            'scheme:/')
120
121
    else:
121
122
        if rest.startswith('/') and not rest.startswith('//'):
122
123
            host = None
139
140
            user, password = user.split(':', 1)
140
141
        else:
141
142
            password = None
 
143
        if user:
 
144
            user = urllib.unquote(user)
 
145
        if password:
 
146
            password = unicode_passwd(urllib.unquote(password))
142
147
    else:
143
148
        user = password = None
144
149
    if host and host.find(':') != -1: