__main__.py 文件源码

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

项目:passpy 作者: bfrascher 项目源码 文件源码
def init(ctx, gpg_ids, path):
    """Initialize new password storage and use `gpg-id` for encryption.
    Mutliple gpg-ids may be specified, in order to encrypt each
    password with multiple ids.  This command must be run first before
    a password store can be used.  If the specified `gpg-id` is
    different from the ye used in any existing files, these files will
    be reencrypted to use the new id.  Note that use of an gpg agent
    is recommended so that the batch decryption does not require as
    much user intervention.  If `--path` or `-p` is specified, along
    with an argument, a specific gpg-id or a set of gpg-ids is
    assigned for that specific sub folder of the password store.  If
    only the gpg-id is given, and it is an empty string then the
    current `.gpg-id` file for the specfified `sub-folder` (or root if
    unspecified) is removed.

    """
    try:
        ctx.obj.init_store(list(gpg_ids), path=path)
    except PermissionError:
        click.echo(MSG_PERMISSION_ERROR)
        return 1

    click.echo('Password store initialised for {0}.'
               .format(','.join(gpg_ids)))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号