Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
resume up api version default to v2
  • Loading branch information
YangSen-qn committed Jul 3, 2025
commit a0b01d00b072ab4f442fc43f668ebe2c3e61dc1d
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

*.py[cod]

tests/cases/env
my-test-env.sh

##
Expand Down
4 changes: 2 additions & 2 deletions examples/upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# flake8: noqa
# import hashlib

from qiniu import Auth, put_file, urlsafe_base64_encode
from qiniu import Auth, put_file_v2, urlsafe_base64_encode
import qiniu.config
from qiniu.compat import is_py2, is_py3

Expand Down Expand Up @@ -37,7 +37,7 @@
# 'x-qn-meta-md5': hasher.hexdigest()
# }

ret, info = put_file(
ret, info = put_file_v2(
token,
key,
localfile
Expand Down
4 changes: 2 additions & 2 deletions examples/upload_callback.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
# flake8: noqa

from qiniu import Auth, put_file
from qiniu import Auth, put_file_v2

access_key = '...'
secret_key = '...'
Expand All @@ -22,6 +22,6 @@

localfile = './sync/bbb.jpg'

ret, info = put_file(token, key, localfile)
ret, info = put_file_v2(token, key, localfile)
print(info)
assert ret['key'] == key
4 changes: 2 additions & 2 deletions examples/upload_pfops.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
# flake8: noqa
from qiniu import Auth, put_file, urlsafe_base64_encode
from qiniu import Auth, urlsafe_base64_encode, put_file_v2

access_key = '...'
secret_key = '...'
Expand Down Expand Up @@ -33,6 +33,6 @@

localfile = './python_video.flv'

ret, info = put_file(token, key, localfile)
ret, info = put_file_v2(token, key, localfile)
print(info)
assert ret['key'] == key
4 changes: 2 additions & 2 deletions examples/upload_with_qvmzone.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
# flake8: noqa

from qiniu import Auth, put_file, urlsafe_base64_encode
from qiniu import Auth, put_file_v2
import qiniu.config
from qiniu import Zone, set_default

Expand Down Expand Up @@ -34,6 +34,6 @@
scheme='http')
set_default(default_zone=zone)

ret, info = put_file(token, key, localfile)
ret, info = put_file_v2(token, key, localfile)
print(info)
assert ret['key'] == key
4 changes: 2 additions & 2 deletions examples/upload_with_zone.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
# flake8: noqa

from qiniu import Auth, put_file
from qiniu import Auth, put_file_v2
from qiniu import Zone, set_default

# 需要填写你的 Access Key 和 Secret Key
Expand Down Expand Up @@ -38,5 +38,5 @@
scheme='https')
set_default(default_zone=zone)

ret, info = put_file(token, key, localfile)
ret, info = put_file_v2(token, key, localfile)
print(info)
2 changes: 1 addition & 1 deletion qiniu/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

from .services.storage.bucket import BucketManager, build_batch_copy, build_batch_rename, build_batch_move, \
build_batch_stat, build_batch_delete, build_batch_restoreAr, build_batch_restore_ar
from .services.storage.uploader import put_data, put_file, put_stream
from .services.storage.uploader import put_data, put_file, put_file_v2, put_stream, put_stream_v2
from .services.storage.upload_progress_recorder import UploadProgressRecorder
from .services.cdn.manager import CdnManager, DataType, create_timestamp_anti_leech_url, DomainManager
from .services.processing.pfop import PersistentFop
Expand Down
4 changes: 3 additions & 1 deletion qiniu/services/storage/legacy.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,16 @@
import os
import time

from typing_extensions import deprecated

from qiniu import config, http
from qiniu.auth import Auth
from qiniu.compat import json
from qiniu.utils import _file_iter, crc32, rfc_from_timestamp, urlsafe_base64_encode

from qiniu.services.storage.upload_progress_recorder import UploadProgressRecorder


@deprecated("use uploader instead")
class _Resume(object):
"""deprecated 断点续上传类

Expand Down
Loading
Loading