def get_password(wf, show_alfred_items=True):
stored_password = get_stored_password(wf)
auto_password = autodetect_password(wf)
if stored_password is None:
if auto_password is None:
if show_alfred_items:
password_item = wf.add_item('Please set Exchange Password', 'Could not auto detect password from keychain for ' + CREDENTIAL_ENTRY, valid=True, icon=ICON_WARNING)
ret = None
else:
if show_alfred_items:
password_item = wf.add_item('Exchange Password stored in keychain', '(auto detected from keychain)', valid=True, icon='img/ok.png')
ret = auto_password
else:
if show_alfred_items:
password_item = wf.add_item('Exchange Password stored in keychain', 'xxxxxxxxxx', valid=True, icon='img/ok.png')
ret = stored_password
if show_alfred_items:
password_item.setvar('text_to_display','Exchange Password')
password_item.setvar('settings_value' ,'password')
return ret
评论列表
文章目录