def dump_profile(profile):
'''?????????.
???????????????, ??????????, ???keyring??
???.
???????, ???????.
'''
profile = profile.copy()
path = os.path.join(Config.CONF_DIR, profile['username'])
if profile['remember-password'] and profile['password']:
for i in range(RETRIES):
try:
keyring.set_password(Config.DBUS_APP_NAME, profile['username'],
profile['password'])
break
except dbus.exceptions.DBusException:
logger.error(traceback.format_exc())
profile['password'] = ''
with open(path, 'w') as fh:
json.dump(profile, fh)
评论列表
文章目录