<commit_before>from tkinter import *
from backend import Database

database=Database("Estimations.db")

def get_selected_row(event):
    global selected_tuple
    index=list1.curselection()[0]
    selected_tuple=list1.get(index)
    e1.delete(0,END)
    e1.insert(END,selected_tuple[1])
    e2.delete(0,END)
    e2.insert(END,selected_tuple[2])
    e3.delete(0,END)
    e3.insert(END,selected_tuple[3])
    e4.delete(0,END)
    e4.insert(END,selected_tuple[4])


def view_command():
    list1.delete(0,END)
    for row in database.view():
        list1.insert(END,row)

def report_command():
    list1.delete(0,END)
    for row in database.report():
        list1.insert(END,row)

def search_command():
    list1.delete(0,END)
    for row in database.search(cabinettype_text.get(),dimension_text.get(),productid_text.get(),brand_text.get()):
        list1.insert(END,row)

def add_command():
    database.insert(cabinettype_text.get(),dimension_text.get(),productid_text.get(),brand_text.get())
    list1.delete(0,END)
    list1.insert(END,(cabinettype_text.get(),dimension_text.get(),productid_text.get(),brand_text.get()))

def delete_command():
    database.delete(selected_tuple[0])

def update_command():
    database.update(selected_tuple[0],cabinettype_text.get(),dimension_text.get(),productid_text.get(),brand_text.get())
<commit_msg>Update frontend.py<commit_after>from tkinter import *
from backend import Database

database=Database("Estimations.db")

def get_selected_row(event):
    global selected_tuple
    index=list1.curselection()[0]
    selected_tuple=list1.get(index)
    e1.delete(0,END)
    e1.insert(END,selected_tuple[1])
    e2.delete(0,END)
    e2.insert(END,selected_tuple[2])
    e3.delete(0,END)
    e3.insert(END,selected_tuple[3])
    e4.delete(0,END)
    e4.insert(END,selected_tuple[4])


def view_command():
    list1.delete(0,END)
    for row in database.view():
        list1.insert(END,row)

def report_command():
    list1.delete(0,END)
    row=database.report()
    for i in row:
        if i[2]>0:
            list1.insert(END,i)

def search_command():
    list1.delete(0,END)
    for row in database.search(cabinettype_text.get(),dimension_text.get(),productid_text.get(),brand_text.get()):
        list1.insert(END,row)

def add_command():
    database.insert(cabinettype_text.get(),dimension_text.get(),productid_text.get(),brand_text.get())
    list1.delete(0,END)
    list1.insert(END,(cabinettype_text.get(),dimension_text.get(),productid_text.get(),brand_text.get()))

def delete_command():
    database.delete(selected_tuple[0])

def update_command():
    database.update(selected_tuple[0],cabinettype_text.get(),dimension_text.get(),productid_text.get(),brand_text.get())

{'fraction_non_alphanumeric': 0.14988978692138133, 'fraction_numerical': 0.024981631153563555, 'mean_word_length': 4.893939393939394, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5671009', 'n_tokens_mistral': 983, 'n_tokens_neox': 969, 'n_words': 118}