Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def __init__(self):
# Upon first created instance, open the database:
global _repositoryInitialized, _shared_state
if not _repositoryInitialized:
_shared_state = {}
_storage = FileStorage('_Repository_')
_db = db.DB(_storage)
_connection = _db.open()
_dbroot = _connection.root()
if not _dbroot.has_key('thingList'):
_dbroot['thingList'] = PersistentList()
_shared_state['thingList'] = _dbroot['thingList']
transaction.get_transaction().commit()
_repositoryInitialized = True
self.__dict__ = _shared_state
def commit(self):
transaction.get_transaction().commit()
def save(self):
transaction.get_transaction().commit()
print 'Poing db saved'
def Commit(self):
""" Commit all ZODB changes.
"""
transaction.get_transaction().commit()
def commit(self):
transaction.get_transaction().commit()
print 'Poing db saved'
def commit(self):
transaction.get_transaction().commit()
print 'Poing db saved'
def abort(self):
transaction.get_transaction().abort()
def abort(self):
transaction.get_transaction().abort()