__main__.py 文件源码

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

项目:passpy 作者: bfrascher 项目源码 文件源码
def cp(ctx, old_path, new_path, force):
    """Copies the password or directory names `old-path` to `new-path`.
    This command is alternatively named `copy`.  If `--force` is
    specified, silently overwrite `new_path` if it exists.  If
    `new-path` ends in a trailing `/`, it is always treated as a
    directory.  Passwords are selectively reencrypted to the
    corresponding keys of their new destination.

    """
    try:
        ctx.obj.copy_path(old_path, new_path, force)
    except StoreNotInitialisedError:
        click.echo(MSG_STORE_NOT_INITIALISED_ERROR)
        return 1
    except FileNotFoundError:
        click.echo('{0} is not in the password store.'.format(old_path))
        return 1
    except PermissionError:
        click.echo(MSG_PERMISSION_ERROR)
        return 1
    except RecursiveCopyMoveError:
        click.echo(MSG_RECURSIVE_COPY_MOVE_ERROR.format('copy'))
        return 1
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号