FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
python-sdk/examples/batch.py at patch-1 · dawncold/python-sdk · GitHub
dawncold
/
python-sdk
Public
forked from
qiniu/python-sdk
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
python-sdk
/
examples
/
batch.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
executable file
·
26 lines (20 loc) · 614 Bytes
Breadcrumbs
python-sdk
/
examples
/
batch.py
Copy path
File metadata and controls
executable file
·
26 lines (20 loc) · 614 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# -*- coding: utf-8 -*-
# flake8: noqa
from
qiniu
import
Auth
from
qiniu
import
BucketManager
from
qiniu
import
build_batch_copy
from
qiniu
import
build_batch_move
,
build_batch_rename
access_key
=
'...'
secret_key
=
'...'
# 初始化Auth状态
q
=
Auth
(
access_key
,
secret_key
)
# 初始化BucketManager
bucket
=
BucketManager
(
q
)
keys
=
{
'123.jpg'
:
'123.jpg'
}
# ops = build_batch_copy( 'teest', keys, 'teest',force='true')
# ops = build_batch_move('teest', keys, 'teest', force='true')
ops
=
build_batch_rename
(
'teest'
,
keys
,
force
=
'true'
)
ret
,
info
=
bucket
.
batch
(
ops
)
print
(
ret
)
print
(
info
)
assert
ret
==
{}
Back
|
FazBrowse Home
|
New Git URL