~loggerhead-team/loggerhead/trunk-rich

« back to all changes in this revision

Viewing changes to loggerhead/changecache.py

  • Committer: Michael Hudson
  • Date: 2007-09-07 16:41:32 UTC
  • mto: This revision was merged to the branch mainline in revision 138.
  • Revision ID: michael.hudson@canonical.com-20070907164132-duvb9jefq0xwag8u
barry suggested i switch sqlite interface based on an environment variable, which makes much sense

Show diffs side-by-side

added added

removed removed

Lines of Context:
38
38
 
39
39
with_lock = util.with_lock('_lock', 'ChangeCache')
40
40
 
41
 
#SQLITE_INTERFACE = 'pysqlite2'
42
 
SQLITE_INTERFACE = 'sqlite'
 
41
SQLITE_INTERFACE = os.environ.get('SQLITE_INTERFACE', 'sqlite')
43
42
 
44
43
if SQLITE_INTERFACE == 'pysqlite2':
45
44
    from pysqlite2 import dbapi2
48
47
    import sqlite as dbapi2
49
48
    _param_marker = '%s'
50
49
else:
51
 
    raise AssertionError("bad sqlite interface!?")
 
50
    raise AssertionError("bad sqlite interface %r!?"%SQLITE_INTERFACE)
52
51
 
53
52
_select_stmt = ("select data from revisiondata where revid = ?"
54
53
                ).replace('?', _param_marker)