from sqlalchemy.orm.exc import NoResultFound
from config import Config
-from singleton import Singleton
from textutils import fix_maintainer
################################################################################
# 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
################################################################################
-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)