{"action":"created","comment":{"url":"https://api.github.com/repos/rpm-software-management/dnf/pulls/comments/84516018","pull_request_review_id":5292217,"id":84516018,"diff_hunk":"@@ -0,0 +1,534 @@\n+#!/usr/bin/env python3\n+# Copyright (C) 2016  Red Hat, Inc.\n+# Author: Eduard Cuba <xcubae00@stud.fit.vutbr.cz>\n+# This copyrighted material is made available to anyone wishing to use,\n+# modify, copy, or redistribute it subject to the terms and conditions of\n+# the GNU General Public License v.2, or (at your option) any later version.\n+# This program is distributed in the hope that it will be useful, but WITHOUT\n+# ANY WARRANTY expressed or implied, including the implied warranties of\n+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General\n+# Public License for more details.  You should have received a copy of the\n+# GNU General Public License along with this program; if not, write to the\n+# Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA\n+# 02110-1301, USA.  Any Red Hat trademarks that are incorporated in the\n+# source code or documentation are not subject to the GNU General Public\n+# License and may only be used or replicated with the express permission of\n+# Red Hat, Inc.\n+\n+import os\n+import sys\n+import sqlite3\n+import glob\n+import json\n+\n+################################# FUNCTIONS ###################################\n+\n+def CONSTRUCT_NAME(row):\n+    _NAME = row[1] +'-'+ row[3] +'-'+ row[4] +'-'+ row[5]\n+    return _NAME\n+\n+def PACKAGE_DATA_INSERT(cursor,data):\n+    cursor.execute('INSERT INTO PACKAGE_DATA VALUES (null,?,?,?,?,?,?,?,?)', data)\n+\n+def RPM_DATA_INSERT(cursor,data):\n+    cursor.execute('INSERT INTO RPM_DATA VALUES (null,?,?,?,?,?,?,?,?,?,?,?)', data)\n+\n+def TRANS_DATA_INSERT(cursor,data):\n+    cursor.execute('INSERT INTO TRANS_DATA VALUES (null,?,?,?,?,?,?,?)', data)\n+\n+def TRANS_INSERT(cursor,data):\n+    cursor.execute('INSERT INTO TRANS VALUES (?,?,?,?,?,?,?,?,?)', data)\n+\n+#create binding with repo - returns R_ID\n+def BIND_REPO(cursor,name):\n+    cursor.execute('SELECT R_ID FROM REPO WHERE name=?',(name,))\n+    R_ID = cursor.fetchone()\n+    if R_ID == None:\n+        cursor.execute('INSERT INTO REPO VALUES(null,?,0,0)',(name,))\n+        cursor.execute('SELECT last_insert_rowid()')\n+        R_ID = cursor.fetchone()\n+    return R_ID[0]\n+\n+#create binding with STATE_TYPE - returns ID\n+def BIND_STATE(cursor,desc):\n+    cursor.execute('SELECT ID FROM STATE_TYPE WHERE description=?',(desc,))\n+    STATE_ID = cursor.fetchone()\n+    if STATE_ID == None:\n+        cursor.execute('INSERT INTO STATE_TYPE VALUES(null,?)',(desc,))\n+        cursor.execute('SELECT last_insert_rowid()')\n+        STATE_ID = cursor.fetchone()\n+    return STATE_ID[0]\n+\n+#create binding with REASON_TYPE - returns ID\n+def BIND_REASON(cursor,desc):\n+    cursor.execute('SELECT ID FROM REASON_TYPE WHERE description=?',(desc,))\n+    REASON_ID = cursor.fetchone()\n+    if REASON_ID == None:\n+        cursor.execute('INSERT INTO REASON_TYPE VALUES(null,?)',(desc,))\n+        cursor.execute('SELECT last_insert_rowid()')\n+        REASON_ID = cursor.fetchone()\n+    return REASON_ID[0]\n+\n+#create binding with OUTPUT_TYPE - returns ID\n+def BIND_OUTPUT(cursor,desc):\n+    cursor.execute('SELECT ID FROM OUTPUT_TYPE WHERE description=?',(desc,))\n+    OUTPUT_ID = cursor.fetchone()\n+    if OUTPUT_ID == None:\n+        cursor.execute('INSERT INTO OUTPUT_TYPE VALUES(null,?)',(desc,))\n+        cursor.execute('SELECT last_insert_rowid()')\n+        OUTPUT_ID = cursor.fetchone()\n+    return OUTPUT_ID[0]\n+\n+#package type binding\n+def BIND_PACKAGE(cursor,desc):","path":"dnf/yum/swdb_transformer.py","position":83,"original_position":83,"commit_id":"a76f6d22a4fe7229ab5f6d7220951d822df44340","original_commit_id":"a76f6d22a4fe7229ab5f6d7220951d822df44340","user":{"login":"dnf-bot","id":10563235,"avatar_url":"https://avatars.githubusercontent.com/u/10563235?v=3","gravatar_id":"","url":"https://api.github.com/users/dnf-bot","html_url":"https://github.com/dnf-bot","followers_url":"https://api.github.com/users/dnf-bot/followers","following_url":"https://api.github.com/users/dnf-bot/following{/other_user}","gists_url":"https://api.github.com/users/dnf-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/dnf-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dnf-bot/subscriptions","organizations_url":"https://api.github.com/users/dnf-bot/orgs","repos_url":"https://api.github.com/users/dnf-bot/repos","events_url":"https://api.github.com/users/dnf-bot/events{/privacy}","received_events_url":"https://api.github.com/users/dnf-bot/received_events","type":"User","site_admin":false},"body":"__[flake8]__\n* [E302] expected 2 blank lines, found 1\n* [E231] missing whitespace after ','\n\n<!-- Comment by [SideCI](https://sideci.com) -->","created_at":"2016-10-21T17:08:12Z","updated_at":"2016-10-21T17:08:12Z","html_url":"https://github.com/rpm-software-management/dnf/pull/630#discussion_r84516018","pull_request_url":"https://api.github.com/repos/rpm-software-management/dnf/pulls/630","_links":{"self":{"href":"https://api.github.com/repos/rpm-software-management/dnf/pulls/comments/84516018"},"html":{"href":"https://github.com/rpm-software-management/dnf/pull/630#discussion_r84516018"},"pull_request":{"href":"https://api.github.com/repos/rpm-software-management/dnf/pulls/630"}}},"pull_request":{"url":"https://api.github.com/repos/rpm-software-management/dnf/pulls/630","id":88065455,"html_url":"https://github.com/rpm-software-management/dnf/pull/630","diff_url":"https://github.com/rpm-software-management/dnf/pull/630.diff","patch_url":"https://github.com/rpm-software-management/dnf/pull/630.patch","issue_url":"https://api.github.com/repos/rpm-software-management/dnf/issues/630","number":630,"state":"open","locked":false,"title":"WIP: SWDB preview","user":{"login":"edynox","id":18234754,"avatar_url":"https://avatars.githubusercontent.com/u/18234754?v=3","gravatar_id":"","url":"https://api.github.com/users/edynox","html_url":"https://github.com/edynox","followers_url":"https://api.github.com/users/edynox/followers","following_url":"https://api.github.com/users/edynox/following{/other_user}","gists_url":"https://api.github.com/users/edynox/gists{/gist_id}","starred_url":"https://api.github.com/users/edynox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edynox/subscriptions","organizations_url":"https://api.github.com/users/edynox/orgs","repos_url":"https://api.github.com/users/edynox/repos","events_url":"https://api.github.com/users/edynox/events{/privacy}","received_events_url":"https://api.github.com/users/edynox/received_events","type":"User","site_admin":false},"body":"Hi, this is preview for SWDB integration in DNF.\r\nMost of functions should be working now, old databases are not used anymore.\r\nIt would be fine to have separate branch for that...\r\n\r\nIt requires dnf-swdb libhif module, see [https://github.com/edynox/libhif](https://github.com/edynox/libhif)\r\n\r\n[demo.pdf](https://github.com/rpm-software-management/dnf/files/511065/demo.pdf)\r\n","created_at":"2016-10-05T12:09:46Z","updated_at":"2016-10-21T17:08:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5820329a35493d579433d5489ca85cc3b515b1dc","assignee":{"login":"ignatenkobrain","id":2866862,"avatar_url":"https://avatars.githubusercontent.com/u/2866862?v=3","gravatar_id":"","url":"https://api.github.com/users/ignatenkobrain","html_url":"https://github.com/ignatenkobrain","followers_url":"https://api.github.com/users/ignatenkobrain/followers","following_url":"https://api.github.com/users/ignatenkobrain/following{/other_user}","gists_url":"https://api.github.com/users/ignatenkobrain/gists{/gist_id}","starred_url":"https://api.github.com/users/ignatenkobrain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ignatenkobrain/subscriptions","organizations_url":"https://api.github.com/users/ignatenkobrain/orgs","repos_url":"https://api.github.com/users/ignatenkobrain/repos","events_url":"https://api.github.com/users/ignatenkobrain/events{/privacy}","received_events_url":"https://api.github.com/users/ignatenkobrain/received_events","type":"User","site_admin":false},"assignees":[{"login":"ignatenkobrain","id":2866862,"avatar_url":"https://avatars.githubusercontent.com/u/2866862?v=3","gravatar_id":"","url":"https://api.github.com/users/ignatenkobrain","html_url":"https://github.com/ignatenkobrain","followers_url":"https://api.github.com/users/ignatenkobrain/followers","following_url":"https://api.github.com/users/ignatenkobrain/following{/other_user}","gists_url":"https://api.github.com/users/ignatenkobrain/gists{/gist_id}","starred_url":"https://api.github.com/users/ignatenkobrain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ignatenkobrain/subscriptions","organizations_url":"https://api.github.com/users/ignatenkobrain/orgs","repos_url":"https://api.github.com/users/ignatenkobrain/repos","events_url":"https://api.github.com/users/ignatenkobrain/events{/privacy}","received_events_url":"https://api.github.com/users/ignatenkobrain/received_events","type":"User","site_admin":false},{"login":"jsilhan","id":5243763,"avatar_url":"https://avatars.githubusercontent.com/u/5243763?v=3","gravatar_id":"","url":"https://api.github.com/users/jsilhan","html_url":"https://github.com/jsilhan","followers_url":"https://api.github.com/users/jsilhan/followers","following_url":"https://api.github.com/users/jsilhan/following{/other_user}","gists_url":"https://api.github.com/users/jsilhan/gists{/gist_id}","starred_url":"https://api.github.com/users/jsilhan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jsilhan/subscriptions","organizations_url":"https://api.github.com/users/jsilhan/orgs","repos_url":"https://api.github.com/users/jsilhan/repos","events_url":"https://api.github.com/users/jsilhan/events{/privacy}","received_events_url":"https://api.github.com/users/jsilhan/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/rpm-software-management/dnf/pulls/630/commits","review_comments_url":"https://api.github.com/repos/rpm-software-management/dnf/pulls/630/comments","review_comment_url":"https://api.github.com/repos/rpm-software-management/dnf/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rpm-software-management/dnf/issues/630/comments","statuses_url":"https://api.github.com/repos/rpm-software-management/dnf/statuses/a76f6d22a4fe7229ab5f6d7220951d822df44340","head":{"label":"edynox:hif-swdb","ref":"hif-swdb","sha":"a76f6d22a4fe7229ab5f6d7220951d822df44340","user":{"login":"edynox","id":18234754,"avatar_url":"https://avatars.githubusercontent.com/u/18234754?v=3","gravatar_id":"","url":"https://api.github.com/users/edynox","html_url":"https://github.com/edynox","followers_url":"https://api.github.com/users/edynox/followers","following_url":"https://api.github.com/users/edynox/following{/other_user}","gists_url":"https://api.github.com/users/edynox/gists{/gist_id}","starred_url":"https://api.github.com/users/edynox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edynox/subscriptions","organizations_url":"https://api.github.com/users/edynox/orgs","repos_url":"https://api.github.com/users/edynox/repos","events_url":"https://api.github.com/users/edynox/events{/privacy}","received_events_url":"https://api.github.com/users/edynox/received_events","type":"User","site_admin":false},"repo":{"id":64313545,"name":"dnf","full_name":"edynox/dnf","owner":{"login":"edynox","id":18234754,"avatar_url":"https://avatars.githubusercontent.com/u/18234754?v=3","gravatar_id":"","url":"https://api.github.com/users/edynox","html_url":"https://github.com/edynox","followers_url":"https://api.github.com/users/edynox/followers","following_url":"https://api.github.com/users/edynox/following{/other_user}","gists_url":"https://api.github.com/users/edynox/gists{/gist_id}","starred_url":"https://api.github.com/users/edynox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edynox/subscriptions","organizations_url":"https://api.github.com/users/edynox/orgs","repos_url":"https://api.github.com/users/edynox/repos","events_url":"https://api.github.com/users/edynox/events{/privacy}","received_events_url":"https://api.github.com/users/edynox/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/edynox/dnf","description":"dnf is a package manager based on yum and libsolv","fork":true,"url":"https://api.github.com/repos/edynox/dnf","forks_url":"https://api.github.com/repos/edynox/dnf/forks","keys_url":"https://api.github.com/repos/edynox/dnf/keys{/key_id}","collaborators_url":"https://api.github.com/repos/edynox/dnf/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/edynox/dnf/teams","hooks_url":"https://api.github.com/repos/edynox/dnf/hooks","issue_events_url":"https://api.github.com/repos/edynox/dnf/issues/events{/number}","events_url":"https://api.github.com/repos/edynox/dnf/events","assignees_url":"https://api.github.com/repos/edynox/dnf/assignees{/user}","branches_url":"https://api.github.com/repos/edynox/dnf/branches{/branch}","tags_url":"https://api.github.com/repos/edynox/dnf/tags","blobs_url":"https://api.github.com/repos/edynox/dnf/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/edynox/dnf/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/edynox/dnf/git/refs{/sha}","trees_url":"https://api.github.com/repos/edynox/dnf/git/trees{/sha}","statuses_url":"https://api.github.com/repos/edynox/dnf/statuses/{sha}","languages_url":"https://api.github.com/repos/edynox/dnf/languages","stargazers_url":"https://api.github.com/repos/edynox/dnf/stargazers","contributors_url":"https://api.github.com/repos/edynox/dnf/contributors","subscribers_url":"https://api.github.com/repos/edynox/dnf/subscribers","subscription_url":"https://api.github.com/repos/edynox/dnf/subscription","commits_url":"https://api.github.com/repos/edynox/dnf/commits{/sha}","git_commits_url":"https://api.github.com/repos/edynox/dnf/git/commits{/sha}","comments_url":"https://api.github.com/repos/edynox/dnf/comments{/number}","issue_comment_url":"https://api.github.com/repos/edynox/dnf/issues/comments{/number}","contents_url":"https://api.github.com/repos/edynox/dnf/contents/{+path}","compare_url":"https://api.github.com/repos/edynox/dnf/compare/{base}...{head}","merges_url":"https://api.github.com/repos/edynox/dnf/merges","archive_url":"https://api.github.com/repos/edynox/dnf/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/edynox/dnf/downloads","issues_url":"https://api.github.com/repos/edynox/dnf/issues{/number}","pulls_url":"https://api.github.com/repos/edynox/dnf/pulls{/number}","milestones_url":"https://api.github.com/repos/edynox/dnf/milestones{/number}","notifications_url":"https://api.github.com/repos/edynox/dnf/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/edynox/dnf/labels{/name}","releases_url":"https://api.github.com/repos/edynox/dnf/releases{/id}","deployments_url":"https://api.github.com/repos/edynox/dnf/deployments","created_at":"2016-07-27T14:05:57Z","updated_at":"2016-09-22T11:35:30Z","pushed_at":"2016-10-21T17:05:04Z","git_url":"git://github.com/edynox/dnf.git","ssh_url":"git@github.com:edynox/dnf.git","clone_url":"https://github.com/edynox/dnf.git","svn_url":"https://github.com/edynox/dnf","homepage":"","size":35834,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"hif-swdb"}},"base":{"label":"rpm-software-management:master","ref":"master","sha":"b2720810117a7ce2654c6c22af563b79ef15f71b","user":{"login":"rpm-software-management","id":8504469,"avatar_url":"https://avatars.githubusercontent.com/u/8504469?v=3","gravatar_id":"","url":"https://api.github.com/users/rpm-software-management","html_url":"https://github.com/rpm-software-management","followers_url":"https://api.github.com/users/rpm-software-management/followers","following_url":"https://api.github.com/users/rpm-software-management/following{/other_user}","gists_url":"https://api.github.com/users/rpm-software-management/gists{/gist_id}","starred_url":"https://api.github.com/users/rpm-software-management/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rpm-software-management/subscriptions","organizations_url":"https://api.github.com/users/rpm-software-management/orgs","repos_url":"https://api.github.com/users/rpm-software-management/repos","events_url":"https://api.github.com/users/rpm-software-management/events{/privacy}","received_events_url":"https://api.github.com/users/rpm-software-management/received_events","type":"Organization","site_admin":false},"repo":{"id":3671909,"name":"dnf","full_name":"rpm-software-management/dnf","owner":{"login":"rpm-software-management","id":8504469,"avatar_url":"https://avatars.githubusercontent.com/u/8504469?v=3","gravatar_id":"","url":"https://api.github.com/users/rpm-software-management","html_url":"https://github.com/rpm-software-management","followers_url":"https://api.github.com/users/rpm-software-management/followers","following_url":"https://api.github.com/users/rpm-software-management/following{/other_user}","gists_url":"https://api.github.com/users/rpm-software-management/gists{/gist_id}","starred_url":"https://api.github.com/users/rpm-software-management/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rpm-software-management/subscriptions","organizations_url":"https://api.github.com/users/rpm-software-management/orgs","repos_url":"https://api.github.com/users/rpm-software-management/repos","events_url":"https://api.github.com/users/rpm-software-management/events{/privacy}","received_events_url":"https://api.github.com/users/rpm-software-management/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rpm-software-management/dnf","description":"dnf is a package manager based on yum and libsolv","fork":false,"url":"https://api.github.com/repos/rpm-software-management/dnf","forks_url":"https://api.github.com/repos/rpm-software-management/dnf/forks","keys_url":"https://api.github.com/repos/rpm-software-management/dnf/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rpm-software-management/dnf/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rpm-software-management/dnf/teams","hooks_url":"https://api.github.com/repos/rpm-software-management/dnf/hooks","issue_events_url":"https://api.github.com/repos/rpm-software-management/dnf/issues/events{/number}","events_url":"https://api.github.com/repos/rpm-software-management/dnf/events","assignees_url":"https://api.github.com/repos/rpm-software-management/dnf/assignees{/user}","branches_url":"https://api.github.com/repos/rpm-software-management/dnf/branches{/branch}","tags_url":"https://api.github.com/repos/rpm-software-management/dnf/tags","blobs_url":"https://api.github.com/repos/rpm-software-management/dnf/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rpm-software-management/dnf/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rpm-software-management/dnf/git/refs{/sha}","trees_url":"https://api.github.com/repos/rpm-software-management/dnf/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rpm-software-management/dnf/statuses/{sha}","languages_url":"https://api.github.com/repos/rpm-software-management/dnf/languages","stargazers_url":"https://api.github.com/repos/rpm-software-management/dnf/stargazers","contributors_url":"https://api.github.com/repos/rpm-software-management/dnf/contributors","subscribers_url":"https://api.github.com/repos/rpm-software-management/dnf/subscribers","subscription_url":"https://api.github.com/repos/rpm-software-management/dnf/subscription","commits_url":"https://api.github.com/repos/rpm-software-management/dnf/commits{/sha}","git_commits_url":"https://api.github.com/repos/rpm-software-management/dnf/git/commits{/sha}","comments_url":"https://api.github.com/repos/rpm-software-management/dnf/comments{/number}","issue_comment_url":"https://api.github.com/repos/rpm-software-management/dnf/issues/comments{/number}","contents_url":"https://api.github.com/repos/rpm-software-management/dnf/contents/{+path}","compare_url":"https://api.github.com/repos/rpm-software-management/dnf/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rpm-software-management/dnf/merges","archive_url":"https://api.github.com/repos/rpm-software-management/dnf/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rpm-software-management/dnf/downloads","issues_url":"https://api.github.com/repos/rpm-software-management/dnf/issues{/number}","pulls_url":"https://api.github.com/repos/rpm-software-management/dnf/pulls{/number}","milestones_url":"https://api.github.com/repos/rpm-software-management/dnf/milestones{/number}","notifications_url":"https://api.github.com/repos/rpm-software-management/dnf/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rpm-software-management/dnf/labels{/name}","releases_url":"https://api.github.com/repos/rpm-software-management/dnf/releases{/id}","deployments_url":"https://api.github.com/repos/rpm-software-management/dnf/deployments","created_at":"2012-03-09T15:31:09Z","updated_at":"2016-10-19T01:39:04Z","pushed_at":"2016-10-21T17:05:05Z","git_url":"git://github.com/rpm-software-management/dnf.git","ssh_url":"git@github.com:rpm-software-management/dnf.git","clone_url":"https://github.com/rpm-software-management/dnf.git","svn_url":"https://github.com/rpm-software-management/dnf","homepage":"","size":42932,"stargazers_count":346,"watchers_count":346,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":133,"mirror_url":null,"open_issues_count":17,"forks":133,"open_issues":17,"watchers":346,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rpm-software-management/dnf/pulls/630"},"html":{"href":"https://github.com/rpm-software-management/dnf/pull/630"},"issue":{"href":"https://api.github.com/repos/rpm-software-management/dnf/issues/630"},"comments":{"href":"https://api.github.com/repos/rpm-software-management/dnf/issues/630/comments"},"review_comments":{"href":"https://api.github.com/repos/rpm-software-management/dnf/pulls/630/comments"},"review_comment":{"href":"https://api.github.com/repos/rpm-software-management/dnf/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rpm-software-management/dnf/pulls/630/commits"},"statuses":{"href":"https://api.github.com/repos/rpm-software-management/dnf/statuses/a76f6d22a4fe7229ab5f6d7220951d822df44340"}}}}
{"actor":{"display_login":"dnf-bot"}}