Ejemplo n.º 1
0
    def init(self):
        SQLiteDB.init(self)
        cursor = None
        try:
            cursor = self.connection.cursor()
            cursor.execute("drop table if exists %s" % USER_TABLE)      
            cursor.execute("create table if not exists %s "
                           "(remote_url TEXT UNIQUE, user TEXT, token TEXT)" % REMOTES_USER_TABLE)

        except Exception as e:
            message = "Could not initialize local sqlite database"
            raise ConanException(message, e)
        finally:
            if cursor:
                cursor.close()
Ejemplo n.º 2
0
    def init(self):
        SQLiteDB.init(self)
        cursor = None
        try:
            cursor = self.connection.cursor()

            # To avoid multiple usernames in the login table, use always "login" as id
            cursor.execute("create table if not exists %s (id TEXT UNIQUE, "
                           "username TEXT UNIQUE, token TEXT)" % USER_TABLE)

        except Exception as e:
            message = "Could not initalize local cache"
            raise ConanException(message, e)
        finally:
            if cursor:
                cursor.close()
Ejemplo n.º 3
0
    def init(self):
        SQLiteDB.init(self)
        cursor = None
        try:
            cursor = self.connection.cursor()
            cursor.execute("drop table if exists %s" % USER_TABLE)
            cursor.execute("create table if not exists %s "
                           "(remote_url TEXT UNIQUE, user TEXT, token TEXT)" %
                           REMOTES_USER_TABLE)

        except Exception as e:
            message = "Could not initialize local sqlite database"
            raise ConanException(message, e)
        finally:
            if cursor:
                cursor.close()
Ejemplo n.º 4
0
    def init(self):
        SQLiteDB.init(self)
        cursor = None
        try:
            cursor = self.connection.cursor()

            # To avoid multiple usernames in the login table, use always "login" as id
            cursor.execute("create table if not exists %s (id TEXT UNIQUE, "
                           "username TEXT UNIQUE, token TEXT)" % USER_TABLE)

        except Exception as e:
            message = "Could not initalize local cache"
            raise ConanException(message, e)
        finally:
            if cursor:
                cursor.close()