def changeKey(): keyring = passwordStorage.getKeyring() kr = keyring.get_keyring() key = internalGetpass.getRememberedKey() if key: kr._unlock(key) if hasattr(kr, 'change_keyring_password'): internalGetpass.saveRememberedState() internalGetpass.clearRememberedKey() try: password = kr.change_keyring_password() except errors.AbortException: internalGetpass.restoreRememberedState() return except ValueError: internalGetpass.restoreRememberedState() xbmcgui.Dialog().ok(T(32016), T(32016)) return except: passwordStorage.ERROR( 'chankeKey(): Unhandled change_keyring_password() error.') internalGetpass.restoreRememberedState() return internalGetpass.saveKeyringPass(password) xbmcgui.Dialog().ok(T(32030), T(32031))
def changeKey(): keyring = passwordStorage.getKeyring() kr = keyring.get_keyring() key = internalGetpass.getRememberedKey() if key: kr._unlock(key) if hasattr(kr,'change_keyring_password'): internalGetpass.saveRememberedState() internalGetpass.clearRememberedKey() try: password = kr.change_keyring_password() except errors.AbortException: internalGetpass.restoreRememberedState() return except ValueError: internalGetpass.restoreRememberedState() xbmcgui.Dialog().ok(T(32016),T(32016)) return except: passwordStorage.ERROR('chankeKey(): Unhandled change_keyring_password() error.') internalGetpass.restoreRememberedState() return internalGetpass.saveKeyringPass(password) xbmcgui.Dialog().ok(T(32030),T(32031))
def resetKeyring(self): if not xbmcutil.yesNoDialog(T(32035),T(32036),T(32037),T(32035)): return internalGetpass.clearKeyMemory() keyring = passwordStorage.getKeyring() kr = keyring.get_keyring() kr.reset() passwordStorage.saveKeyToDisk() self.updateDisplay()
def resetKeyring(self): if not xbmcutil.yesNoDialog(T(32035), T(32036), T(32037), T(32035)): return internalGetpass.clearKeyMemory() keyring = passwordStorage.getKeyring() kr = keyring.get_keyring() kr.reset() passwordStorage.saveKeyToDisk() self.updateDisplay()
def storeKey(store=True,kr=None): keyring = passwordStorage.getKeyring() kr = kr or keyring.get_keyring() if store: if hasattr(kr,'change_keyring_password'): keyring_key = internalGetpass.getRandomKey() try: keyring_key = kr.change_keyring_password(keyring_key) except ValueError, e: xbmcgui.Dialog().ok('Error','Failed to unlock keyring:','',e.message) return xbmcgui.Window(10000).setProperty('KEYRING_password',keyring_key) xbmcutil.ADDON.setSetting('keyring_password',keyring_key) xbmcgui.Dialog().ok(T(32017),T(32018))
def storeKey(store=True, kr=None): keyring = passwordStorage.getKeyring() kr = kr or keyring.get_keyring() if store: if hasattr(kr, 'change_keyring_password'): keyring_key = internalGetpass.getRandomKey() try: keyring_key = kr.change_keyring_password(keyring_key) except ValueError, e: xbmcgui.Dialog().ok('Error', 'Failed to unlock keyring:', '', e.message) return xbmcgui.Window(10000).setProperty('KEYRING_password', keyring_key) xbmcutil.ADDON.setSetting('keyring_password', keyring_key) xbmcgui.Dialog().ok(T(32017), T(32018))