def insert(self):
"""
Insert the current B3 instance in the database.
Will also store the B3 instance reference in the QApplication.
"""
# store it in the database first so we get the id
cursor = B3App.Instance().storage.cursor()
cursor.execute("INSERT INTO b3 (config) VALUES (?)", (self.config_path,))
self.id = cursor.lastrowid
LOG.debug('stored new process in the database: @%s:%s', self.id, self.config_path)
cursor.close()
# store in the QApplication
if self not in B3App.Instance().processes:
bisect.insort_left(B3App.Instance().processes, self)
评论列表
文章目录