本文整理匯總了Python中leap.bitmask.config.leapsettings.LeapSettings.set_user方法的典型用法代碼示例。如果您正苦於以下問題:Python LeapSettings.set_user方法的具體用法?Python LeapSettings.set_user怎麽用?Python LeapSettings.set_user使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類leap.bitmask.config.leapsettings.LeapSettings
的用法示例。
在下文中一共展示了LeapSettings.set_user方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: LoginWidget
# 需要導入模塊: from leap.bitmask.config.leapsettings import LeapSettings [as 別名]
# 或者: from leap.bitmask.config.leapsettings.LeapSettings import set_user [as 別名]
#.........這裏部分代碼省略.........
"""
self._state.wait_to_login = wait
if not wait and self._state.login_waiting:
logger.debug("No more waiting, triggering login sequence.")
self._do_login()
def set_provider(self, provider):
"""
Set the provider to use in the login sequence.
:param provider: the provider to use.
:type provider: unicode
"""
self._provider = provider
def set_remember(self, value):
"""
Check the remember user and password checkbox
:param value: True to mark it checked, False otherwise
:type value: bool
"""
self.ui.chkRemember.setChecked(value)
def get_remember(self):
"""
Returns the remember checkbox state
:rtype: bool
"""
return self.ui.chkRemember.isChecked()
def set_user(self, user):
"""
Sets the user and focuses on the next field, password.
:param user: user to set the field to
:type user: str
"""
self.ui.lnUser.setText(user)
self._focus_password()
def get_user(self):
"""
Return the user that appears in the widget.
:rtype: unicode
"""
return self.ui.lnUser.text()
def get_logged_user(self):
"""
Return the current logged user or None if no user is logged in.
The return value has the format: '[email protected]'
:rtype: unicode or None
"""
return self._state.full_logged_username
def set_password(self, password):
"""
Sets the password for the widget
:param password: password to set
:type password: unicode