本文整理汇总了Python中auth.Auth.checkAuth方法的典型用法代码示例。如果您正苦于以下问题:Python Auth.checkAuth方法的具体用法?Python Auth.checkAuth怎么用?Python Auth.checkAuth使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类auth.Auth
的用法示例。
在下文中一共展示了Auth.checkAuth方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: MyElement
# 需要导入模块: from auth import Auth [as 别名]
# 或者: from auth.Auth import checkAuth [as 别名]
#.........这里部分代码省略.........
return self._myColor[0]
@pyqtProperty(str, notify=themeChanged)
def myColor2(self):
return self._myColor[1]
@pyqtSlot(str)
def setTheme(self, theme):
self._myTheme.setTheme(theme)
self.themeChanged.emit()
@pyqtProperty(str, notify=varChanged)
def isiPesan(self):
return self._isiPesan
@pyqtSlot(str, str)
def setInfo(self, judul,isi):
if self._isiPesan != isi:
self._isiPesan = isi
if self._judulPesan != judul:
self._judulPesan = judul
self.varChanged.emit()
@pyqtProperty(str, notify=varChanged)
def judulPesan(self):
return self._judulPesan
@pyqtProperty(str, notify=varChanged)
def getPassword(self):
return self.auth.get_password()
@pyqtProperty(bool, notify=hasRegisterChanged)
def hasRegister(self):
return self.auth.check()
def setRegister(self, register):
if self._hasRegister != register:
self._hasRegister = register
self.hasRegisterChanged.emit()
@pyqtSlot(str, str)
def doRegister(self, hint, userPass):
if self.auth.set_password(userPass, hint):
self.setError(True, "Proses Gagal", "Terjadi kesalahan pada proses pembuatan kata kunci baru.")
else:
self.setError(True, "Perubahan Berhasil", "Kata kunci anda berhasil dirubah dan disimpan.")
self.setRegister(True)
def setLogin(self, login):
if self._hasLogin != login:
self._hasLogin = login
self.hasLoginChanged.emit()
@pyqtProperty(bool, notify=hasErrorChanged)
def hasError(self):
return self._hasError
@pyqtProperty(str, notify=overlayChanged)
def overlay(self):
return self._overlay
@pyqtSlot(str)
def setOverlay(self, overlay):
self._overlay = overlay
self.overlayChanged.emit()
print(self._overlay)
@pyqtSlot(bool, str, str)
def setError(self, error, judul, isi):
if self._hasError != error:
self.setInfo(judul, isi)
self._hasError = error
self.hasErrorChanged.emit()
@pyqtProperty(QStandardItemModel, constant=True)
def userListData(self):
return self._userListData
@pyqtSlot(str)
def check_pass(self, password):
if self.auth.checkAuth(str(password)):
self.setLogin(True)
self.setOverlay("")
else:
self.setError(True, "Gagal Masuk", "kata kunci yang anda masukkan salah, silakan coba lagi.")
def addNewUser(self):
self.getUsers()
for i in self._users:
user = MyUser(i[0],i[4],i[5])
self._userListData.addUserItem(user.getName(),
user.getAvatar(),
user.getHome(),
user.getRealName(),
user.getLock())
def getUsers(self):
for users in pwd.getpwall():
if users[2] >= 1000:
self._users.append(users)