本文整理汇总了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