diff options
Diffstat (limited to 'portage_database.py')
-rw-r--r-- | portage_database.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/portage_database.py b/portage_database.py new file mode 100644 index 0000000..ca7831c --- /dev/null +++ b/portage_database.py @@ -0,0 +1,12 @@ +from contextlib import closing +from database import DatabaseConnection + +class PortageDatabaseConnection(DatabaseConnection): + def __init__(self, db): + super(PortageDatabaseConnection, self).__init__(db.conn) + + # TODO: consider passing these arguments around in a dictionary or kwargs + def insert_group_extra(self, group_id, pkg_name, matches, pkg_failed, test_failed, collision, bug_assignee, bug_cc): + with closing(self.conn.cursor()) as c: + c.execute("insert into `groups_portage` values (%s, %s, %s, %s, %s, %s, %s, %s)", (group_id, pkg_name, matches, pkg_failed, test_failed, collision, bug_assignee, bug_cc)) + self.conn.commit() |