cli.py 文件源码

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

项目:millilauncher 作者: fhfuih 项目源码 文件源码
def config_(action, **kw):
    """
    Configure your launcher and game preferences.
    The 'action' argument is optional, and can be 'reset' or 'wizard'. 
    If it's left blank, only given options will be set.
    Else, given options will be set AFTER the corresponding action is executed.
    """
    if action == 'reset':
        ok = click.prompt('Are you sure you want to reset you settings?', confirmation_prompt=True)
        if ok:
            config.reset()
    elif action == 'wizard':
        _wizard()

    for k, v in kw.items():
        if v is None:
            break
        if isinstance(v, str) and v[0] == '=':
            v = v[1:]
        config[k.replace('-', '_')] = v
    config.save()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号