Пример #1
0
 def fetchmany(self, n):
     try:
         return self.real_cursor.fetchmany(n)
     except:
         s = sys.exc_info()[1]
         if (type(s) == str) and (s.startswith('no more')):
             return None
         raise Error(s)
Пример #2
0
 def execute(self, statement, parameters=None):
     try:
         if parameters:
             result = self.real_cursor.execute(statement, parameters)
         else:
             result = self.real_cursor.execute(statement)
         return result
     except:
         raise Error(sys.exc_info()[1])
Пример #3
0
    def connect(self,
                host=None,
                port=None,
                user='',
                password='',
                database='default'):
        gadfly = self.get_import()
        directory = os.path.dirname(database)
        database = os.path.basename(database)
        if database.endswith('.gfd'):
            database = database[:-4]

        try:
            g = gadfly.gadfly()
            g.startup(database, directory)
            return GadflyDB(g, self)
        except IOError:
            raise Error(sys.exc_info()[1])
Пример #4
0
 def fetchall(self):
     try:
         return self.real_cursor.fetchall()
     except:
         raise Error(sys.exc_info()[1])
Пример #5
0
 def executemany(self, statement, *parameters):
     try:
         return self.real_cursor.executemany(statement, *parameters)
     except:
         raise Error(sys.exc_info()[1])
Пример #6
0
 def close(self):
     try:
         self.real_cursor.close()
     except:
         raise Error(sys.exc_info()[1])