Ejemplo n.º 1
0
import pymysql.cursors
import json
from DBConnector import DBConnector

# Connect to the database
dbconnector = DBConnector('localhost', 'root', '', 'gerrit_test')

inline_comments = dbconnector.inline_comments()
patch_details = dbconnector.patch_details()
patches = dbconnector.patches()
# people = dbconnector.people()
requests = dbconnector.requests()
request_details = dbconnector.request_detail()
review_comments = dbconnector.review_comments()
reviews = dbconnector.reviews()


def getInlineComments(patch_id, req_id):
    I = {}
    for comment in inline_comments:
        if comment["patchset_id"] == patch_id and comment[
                "request_id"] == req_id:
            I[comment["file_name"]] = {
                'comment_id': comment["comment_id"],
                'in_reply_to': comment["in_reply_to"],
                'line_number': comment["line_number"],
                'author_id': comment["author_id"],
                'written_on': comment["written_on"],
                'status': comment["status"],
                'side': comment["side"],
                'message': comment["message"],