@@ -0,0 +1,1100 @@
+#!/usr/bin/env python3%0A#-*- coding:utf-8 -*-%0A%0Aimport sys%0Aimport os%0Afrom qiniu import Auth, put_file, etag, urlsafe_base64_encode%0Aimport qiniu.config%0A%0A%0AACCESS_KEY = os.getenv('QINIU_ACCESS_KEY')%0ASECRET_KEY = os.getenv('QINIU_SECRET_KEY')%0ABUCKET_NAME = os.getenv('QINIU_BUCKET_NAME')%0A%0Aassert(ACCESS_KEY and SECRET_KEY and BUCKET_NAME)%0A%0Adef progress_handler(progress, total):%0A    print(%22%7B%7D/%7B%7D %7B:.2f%7D%22.format(progress, total, progress/total*100))%0A%0A# local_file: local file path%0A# remote_name: %E4%B8%8A%E4%BC%A0%E5%88%B0%E4%B8%83%E7%89%9B%E5%90%8E%E4%BF%9D%E5%AD%98%E7%9A%84%E6%96%87%E4%BB%B6%E5%90%8D%0Adef upload(local_file, remote_name, ttl=3600):%0A    print(local_file, remote_name, ttl)%0A    #%E6%9E%84%E5%BB%BA%E9%89%B4%E6%9D%83%E5%AF%B9%E8%B1%A1%0A    q = Auth(ACCESS_KEY, SECRET_KEY)%0A%0A    #%E7%94%9F%E6%88%90%E4%B8%8A%E4%BC%A0 Token%EF%BC%8C%E5%8F%AF%E4%BB%A5%E6%8C%87%E5%AE%9A%E8%BF%87%E6%9C%9F%E6%97%B6%E9%97%B4%E7%AD%89%0A    token = q.upload_token(BUCKET_NAME, remote_name, ttl)%0A%0A    ret, info = put_file(token, remote_name, local_file, progress_handler=progress_handler)%0A    print(info)%0A    assert ret%5B'key'%5D == remote_name%0A    assert ret%5B'hash'%5D == etag(local_file)%0A%0Aif __name__ == %22__main__%22:%0A    local_file = sys.argv%5B1%5D%0A    remote_name = sys.argv%5B2%5D%0A    upload(local_file, remote_name)%0A%0A    print(%22http://download.pingcap.org/%7B%7D%22.format(remote_name))%0A

add upload scripts (#186)