From 6a4a4b2206bdb3928d2a0ce6e4e0713880862ff7 Mon Sep 17 00:00:00 2001 From: kkhitesh Date: Thu, 17 Jun 2021 12:31:38 +0530 Subject: [PATCH] db_init.py and modules --- creds.py | 1 - .../cv_schema_init.py => cv_schema_init.py | 0 db_init.py | 13 +++++++++++++ main.py | 2 +- client.py => modules/client.py | 8 ++------ modules/creds.py | 1 + login.py => modules/login.py | 12 ++++-------- recruiter.py => modules/recruiter.py | 8 ++------ register.py => modules/register.py | 9 ++------- 9 files changed, 25 insertions(+), 29 deletions(-) delete mode 100644 creds.py rename database init/cv_schema_init.py => cv_schema_init.py (100%) create mode 100644 db_init.py rename client.py => modules/client.py (98%) create mode 100644 modules/creds.py rename login.py => modules/login.py (93%) rename recruiter.py => modules/recruiter.py (98%) rename register.py => modules/register.py (98%) diff --git a/creds.py b/creds.py deleted file mode 100644 index 1920142..0000000 --- a/creds.py +++ /dev/null @@ -1 +0,0 @@ -user_pwd = "kdgandhi" # use your MySQL Password diff --git a/database init/cv_schema_init.py b/cv_schema_init.py similarity index 100% rename from database init/cv_schema_init.py rename to cv_schema_init.py diff --git a/db_init.py b/db_init.py new file mode 100644 index 0000000..ef3f071 --- /dev/null +++ b/db_init.py @@ -0,0 +1,13 @@ +import mysql.connector as sql +from modules.creds import user_pwd +from cv_schema_init import * + +mycon = sql.connect(host='localhost', user='root', passwd=user_pwd) +cur = mycon.cursor() +cur.execute(CREATE_SCHEMA) +cur.execute(Create_users_Table) +cur.execute(Create_recruiter_Table) +cur.execute(Create_client_Table) +cur.execute(Create_Job_Table) +cur.execute(Create_Application_Table) +mycon.close() \ No newline at end of file diff --git a/main.py b/main.py index 1537a75..14ab04b 100644 --- a/main.py +++ b/main.py @@ -1,6 +1,6 @@ from tkinter import * from tkinter import messagebox -from login import * +from modules.login import * root = Tk() root.geometry("1050x700") diff --git a/client.py b/modules/client.py similarity index 98% rename from client.py rename to modules/client.py index 105233f..b85d84e 100644 --- a/client.py +++ b/modules/client.py @@ -3,12 +3,8 @@ from tkinter import messagebox, Label from tkinter_uix.Entry import Entry import mysql.connector as sql -import login as l -from creds import user_pwd - -# mycon = sql.connect(host='localhost', user='root',passwd=user_pwd, database='mydb') -# cur = mycon.cursor() - +import modules.login as l +from modules.creds import user_pwd def get_details(email): global name, location, gen, clicid diff --git a/modules/creds.py b/modules/creds.py new file mode 100644 index 0000000..5aa04c7 --- /dev/null +++ b/modules/creds.py @@ -0,0 +1 @@ +user_pwd = "Hitesh@20" # use your MySQL Password diff --git a/login.py b/modules/login.py similarity index 93% rename from login.py rename to modules/login.py index 7c37d77..3605c2a 100644 --- a/login.py +++ b/modules/login.py @@ -2,14 +2,10 @@ from tkinter import messagebox from tkinter_uix.Entry import Entry import mysql.connector as sql -from register import * -from recruiter import * -from client import * -from creds import user_pwd - -# mycon = sql.connect(host='localhost', user='root', passwd=user_pwd, database='mydb') -# cur = mycon.cursor() - +from modules.register import * +from modules.recruiter import * +from modules.client import * +from modules.creds import user_pwd def success(root, email1): global f diff --git a/recruiter.py b/modules/recruiter.py similarity index 98% rename from recruiter.py rename to modules/recruiter.py index 3a2da12..c8ca1fa 100644 --- a/recruiter.py +++ b/modules/recruiter.py @@ -3,12 +3,8 @@ from tkinter import messagebox, Label from tkinter_uix.Entry import Entry import mysql.connector as sql -import login as l -from creds import user_pwd - -# mycon = sql.connect(host='localhost', user='root', passwd=user_pwd, database='mydb') -# cur = mycon.cursor() - +import modules.login as l +from modules.creds import user_pwd def get_details(email): global name, company, gen, recid diff --git a/register.py b/modules/register.py similarity index 98% rename from register.py rename to modules/register.py index 7ea7ef3..bc4b9a2 100644 --- a/register.py +++ b/modules/register.py @@ -3,13 +3,8 @@ from tkinter import messagebox, Label from tkinter_uix.Entry import Entry import mysql.connector as sql -import login as l -from creds import user_pwd - -# mycon = sql.connect(host='localhost', user='root', -# passwd=user_pwd, database='mydb') -# cur = mycon.cursor() - +import modules.login as l +from modules.creds import user_pwd def logi(root): try: