summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 0afdb59)
raw | patch | inline | side by side (parent: 0afdb59)
author | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Sun, 21 Mar 2004 23:45:44 +0000 (23:45 +0000) | ||
committer | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Sun, 21 Mar 2004 23:45:44 +0000 (23:45 +0000) |
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@2162 57a73879-2fb5-44c3-a270-3262357dd7e2
roundup/backends/back_sqlite.py | patch | blob | history |
index 4c883c9ed923c02337904d91b9845117af7e6211..360fd70b3216ee7b086e051d6990bd1c209bcae0 100644 (file)
-# $Id: back_sqlite.py,v 1.18 2004-03-21 23:39:08 richard Exp $
+# $Id: back_sqlite.py,v 1.19 2004-03-21 23:45:44 richard Exp $
'''Implements a backend for SQLite.
See https://pysqlite.sourceforge.net/ for pysqlite info
from roundup import hyperdb
from roundup.backends import rdbms_common
-from roundup.backends import locking
import sqlite
class Database(rdbms_common.Database):
# ensure files are group readable and writable
os.umask(0002)
- # lock the database
- db = os.path.join(self.config.DATABASE, 'db')
- lockfilenm = db[:-3] + 'lck'
- self.lockfile = locking.acquire_lock(lockfilenm)
- self.lockfile.write(str(os.getpid()))
- self.lockfile.flush()
-
(self.conn, self.cursor) = self.sql_open_connection()
try:
self.cursor.execute('create index ids_name_idx on ids(name)')
self.create_version_2_tables()
- def close(self):
- ''' Close off the connection.
- '''
- self.sql_close()
- if self.lockfile is not None:
- locking.release_lock(self.lockfile)
- if self.lockfile is not None:
- self.lockfile.close()
- self.lockfile = None
-
def create_version_2_tables(self):
self.cursor.execute('create table otks (otk_key varchar, '
'otk_value varchar, otk_time integer)')