def load_profile(profile_name):
path = os.path.join(Config.CONF_DIR, profile_name)<EOL>if not os.path.exists(path):<EOL><INDENT>return DEFAULT_PROFILE<EOL><DEDENT>with open(path) as fh:<EOL><INDENT>profile = json.load(fh)<EOL><DEDENT>for key in DEFAULT_PROFILE:<EOL><INDENT>if key not in profile:<EOL><INDENT>profile[key] = DEFAULT_PROFILE[key]<EOL><DEDENT><DEDENT>global keyring_available<EOL>if keyring_available:<EOL><INDENT>for i in range(RETRIES):<EOL><INDENT>try:<EOL><INDENT>profile['<STR_LIT:password>'] = keyring.get_password(<EOL>Config.DBUS_APP_NAME, profile['<STR_LIT:username>'])<EOL>break<EOL><DEDENT>except (keyring.errors.InitError, dbus.exceptions.DBusException):<EOL><INDENT>logger.error(traceback.format_exc())<EOL><DEDENT><DEDENT>else:<EOL><INDENT>keyring_available = False<EOL><DEDENT><DEDENT>if not profile['<STR_LIT:password>']:<EOL><INDENT>profile['<STR_LIT:password>'] = '<STR_LIT>'<EOL><DEDENT>return profile<EOL>
读取特定帐户的配置信息

    有时, dbus会出现连接错误, 这里会进行重试. 但如果超过最大尝试次数, 就
    会失效, 此时, profile['password'] 是一个空字符串, 所以在下一步, 应该去
    检查一下password是否有效, 如果无效, 应该提醒用户.