python中drop_Python drop包_程序模块 - PyPI - Python中文网

drop是一个Python模块,允许用户通过scp将文件上传到远程www目录,并返回公共URL。文件名基于部分SHA1校验和,可以指定扩展名,支持通过配置文件或命令行参数设置选项。
摘要由CSDN通过智能技术生成

用法

您可以按参数发送文件:$ drop defaults.cfg

http://hawo.net/~sijuhamm/d/NcT0jFb5.cfg

或通过stdin的任何内容:$ date | ./drop.py

http://hawo.net/~sijuhamm/d/ephtK9DY

远程位置的文件名实际上是文件的部分sha1校验和。校验和的长度可以在配置文件中设置。尽可能保留扩展名,也可以使用–extension参数覆盖扩展名。

完整的帮助信息如下:usage: drop [-h] [--destination DESTINATION] [--list-destinations]

[--preserve-name] [--extension EXTENSION] [--config-file CONFIG_FILE]

[--test] infile [infile ...]

Uploads data to a remote www directory via scp and returns a public url.

positional arguments:

infile File to upload. If multiple are passed, they will be

archived and compressed before uploading.

optional arguments:

-h, --help show this help message and exit

--destination DESTINATION, -d DESTINATION

Name of destination as found in configuration file.

--list-destinations, -l

List all destinations defined in configuration file.

--preserve-name, -p Will preserve original filename at remote location, by

adding an intermediate directory.

--extension EXTENSION, -e EXTENSION

Overwrites extension on uploaded file.

--config-file CONFIG_FILE, -c CONFIG_FILE

--test Runs a test on destination.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值