Esempio n. 1
0
	def v_sign_up(self):
		
		# Check Password + Register username and password in Database

		if self.signup_password.text() == self.signup_password_2.text():

			self.hide()
			self.window = Main_Page.Main_Page()
			Main_Page.Main_Page.style(self)

			# ---- Query ---- #

			Database.Connection.sign_up(self)

		else:
			self.window = Popup_Wrong_Password_Sign_Up()
			Main_Page.Main_Page.style(self)
Esempio n. 2
0
	def v_login(self):

		# Check password in Database match with the Client

		if Database.Connection.check_existing_profile(self)[0] == self.username.text() and \
			Database.Connection.check_existing_profile(self)[1] == self.password.text():

			global t_name
			t_name = self.username.text()

			self.hide()
			self.window = Main_Page.Main_Page()
			Main_Page.Main_Page.style(self)

		else:
			self.window = Popup_Wrong_Password()
			Main_Page.Main_Page.style(self)
    def save_settings_svm(self):

        # ----- Connection ----- #

        config = {
            'user': '******',
            'host': 'localhost',
            'password': '',
            'database': 'automatic_learning'
        }

        conn = mysql.connector.connect(**config)
        conn.set_converter_class(Converter.NumpyMySQLConverter)

        cursor = conn.cursor()

        # ----- Get Variables ----- #

        date = datetime.datetime.now()
        name = self.settings_name.text(
        ) if not self.settings_name.text() == '' else str(
            date.strftime("%d/%m/%Y %H:%M"))
        fk_profile = "SELECT id FROM profile WHERE username ='******'"
        cursor.execute(fk_profile)

        # ----- Execute Query ----- #

        rows = cursor.fetchall()

        sql = "INSERT INTO svm_settings (date, test_size, kernel, name, fk_profile) VALUES (%s, %s, %s, %s, %s)"
        val = (date, self.test_size, self.kernel, name, rows[0][0])

        cursor.execute(sql, val)
        conn.commit()

        # ----- Back to Main Page ----- #

        time.sleep(1)

        self.hide()
        self.window = Main_Page.Main_Page()
        Main_Page.Main_Page.style(self)
Esempio n. 4
0
 def clicked_back(self):
     self.hide()
     self.window = Main_Page.Main_Page()
     Main_Page.Main_Page.style(self)
 def clicked_main_menu(self):
     self.hide()
     self.window = Main_Page.Main_Page()
     Main_Page.Main_Page.style(self)