def isValidDatabase(self, path): if not QFile.exists(path): return False try: conn = sqlite.connect(path) except self.connection_error_types() as e: return False conn.close() return True
def isValidDatabase(self, path): if not QFile.exists(path): return False try: conn = sqlite.connect(path) except self.connection_error_types(): return False conn.close() return True
def readHistoryFile(self): fileExist = QFile.exists(_historyFile) if fileExist: rH = codecs.open(_historyFile, 'r', encoding='utf-8') for line in rH: if line != "\n": l = line.rstrip('\n') self.updateHistory(l) else: return
def __init__(self, uri): DBConnector.__init__(self, uri) self.dbname = uri.database() if not QFile.exists(self.dbname): raise ConnectionError(QApplication.translate("DBManagerPlugin", '"{0}" not found').format(self.dbname)) try: self.connection = sqlite.connect(self._connectionInfo()) except self.connection_error_types() as e: raise ConnectionError(e) self._checkSpatial() self._checkRaster() self._checkGeopackage()
def __init__(self, uri): DBConnector.__init__(self, uri) self.dbname = uri.database() if not QFile.exists(self.dbname): raise ConnectionError( QApplication.translate("DBManagerPlugin", '"{0}" not found').format(self.dbname)) try: self.connection = sqlite.connect(self._connectionInfo()) except self.connection_error_types() as e: raise ConnectionError(e) self._checkSpatial() self._checkRaster() self._checkGeopackage()