-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathauthint.py
executable file
·34 lines (29 loc) · 1.11 KB
/
authint.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import PyQt5, json
from vkscript import authct
from PyQt5 import QtWidgets
from uiFiles import authUI
class authint(QtWidgets.QMainWindow):
def __init__(self):
super(authint, self).__init__()
self.ui = authUI.Ui_MainWindow();
self.ui.setupUi(self)
self.ui.startButton.clicked.connect(self.storeValues)
self.show()
def storeValues(self):
login = self.ui.loginLine.text()
try:
int(login)
except ValueError:
QtWidgets.QMessageBox.question(self, "ошибка","в поле номера введены не только цифры. Повторите попытку",QtWidgets.QMessageBox.Yes | QtWidgets.QMessageBox.No, QtWidgets.QMessageBox.No)
return
password = self.ui.passLine.text()
user = (login,password)
result = authct.auth(user, self)
if result == 1:
return
print(result)
f = open('settings.json','w')
userDict = {"number":login,"password":password}
json.dump(userDict, f)
f.close()
self.close()