def dump_profile(profile):
profile = profile.copy()<EOL>path = os.path.join(Config.CONF_DIR, profile['<STR_LIT:username>'])<EOL>if profile['<STR_LIT>'] and profile['<STR_LIT:password>']:<EOL><INDENT>for i in range(RETRIES):<EOL><INDENT>try:<EOL><INDENT>keyring.set_password(Config.DBUS_APP_NAME, profile['<STR_LIT:username>'],<EOL>profile['<STR_LIT:password>'])<EOL>break<EOL><DEDENT>except dbus.exceptions.DBusException:<EOL><INDENT>logger.error(traceback.format_exc())<EOL><DEDENT><DEDENT><DEDENT>profile['<STR_LIT:password>'] = '<STR_LIT>'<EOL>with open(path, '<STR_LIT:w>') as fh:<EOL><INDENT>json.dump(profile, fh)<EOL><DEDENT>
保存帐户的配置信息.

    这里会检查用户是否愿意保存密码, 如果需要保存密码的话, 就调用keyring来存
    放密码.
    但如果密码为空, 就不再存放它了.