Beispiel #1
0
    def loginCheck(self):
        username = unicode(self.uname_lineEdit.text())
        password = unicode(self.pass_lineEdit.text())

        data = 'USERNAME: '******' PASSWORD: '******'')
            tcpCliSock.close()
        except error:
            print 'THERE IS NO OPEN RoyTify SERVER IN LAN!'

        if data == "True":
            print("User Found ! ")

            filer = open(r"my_username.txt", "w")
            filer.write(username)
            filer.close()

            self.welcomeWindowShow()
        else:
            print("User Not Found !")
            Ui_signUp.showMessageBox(Ui_signUp(), 'Warning',
                                     'Invalid Username And Password')
Beispiel #2
0
    def tableClickedDisover(self, row, column):

        indexit = self.musicTable_1.currentRow()
        connection = sqlite3.connect("songs_info.db")
        name = (
            connection.execute("SELECT * FROM SONGS")).fetchall()[indexit][0]
        try:
            print self.indexer.index(indexit)
            Ui_signUp.showMessageBox(
                Ui_signUp(), 'Notice',
                self.username + ', \nyou have already bought ' + name)
        except ValueError:
            if float(str(self.textEdit.toPlainText())) < self.price:
                Ui_signUp.showMessageBox(
                    Ui_signUp(), 'Notice', self.username +
                    ', \nyou have less money than needed for ' + name)
            else:
                self.textEdit.setText(
                    str(float(str(self.textEdit.toPlainText())) - self.price))
                self.indexer.append(indexit)
                self.addFiles_playList()