]> git.decadent.org.uk Git - dak.git/blobdiff - daklib/dbconn.py
Drop executable bits on libraries.
[dak.git] / daklib / dbconn.py
old mode 100755 (executable)
new mode 100644 (file)
index 00026a8..fd8ab7c
@@ -51,7 +51,6 @@ from sqlalchemy.exc import *
 from sqlalchemy.orm.exc import NoResultFound
 
 from config import Config
-from singleton import Singleton
 from textutils import fix_maintainer
 
 ################################################################################
@@ -456,7 +455,7 @@ class BuildQueue(object):
 
         # Prepare BuildQueueFile object
         qf = BuildQueueFile()
-        qf.queue_id = self.queue_id
+        qf.build_queue_id = self.queue_id
         qf.lastused = datetime.now()
         qf.filename = poolfile_basename
 
@@ -2502,18 +2501,19 @@ __all__.append('UploadBlock')
 
 ################################################################################
 
-class DBConn(Singleton):
+class DBConn(object):
     """
     database module init.
     """
+    __shared_state = {}
+
     def __init__(self, *args, **kwargs):
-        super(DBConn, self).__init__(*args, **kwargs)
+        self.__dict__ = self.__shared_state
 
-    def _startup(self, *args, **kwargs):
-        self.debug = False
-        if kwargs.has_key('debug'):
-            self.debug = True
-        self.__createconn()
+        if not getattr(self, 'initialised', False):
+            self.initialised = True
+            self.debug = kwargs.has_key('debug')
+            self.__createconn()
 
     def __setuptables(self):
         self.tbl_architecture = Table('architecture', self.db_meta, autoload=True)