"""Returns if a valid session has been opened for reading the database"""
returnself.sessionisnotNone
defassert_validity(self):
"""Raise a RuntimeError if the database backend is not available"""
ifnotself.is_valid():
raiseRuntimeError("Database '%s' cannot be found at expected location '%s'. Create it and then try re-connecting using Database.connect()"%(INFO.name(),SQLITE_FILE))