gutil.py 文件源码

python
阅读 17 收藏 0 点赞 0 评论 0

项目:bcloud 作者: wangYanJava 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号