예제 #1
0
파일: connector.py 프로젝트: boggins/QGIS
 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
예제 #2
0
 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
예제 #3
0
 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
예제 #4
0
파일: connector.py 프로젝트: boggins/QGIS
    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()
예제 #5
0
    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()