Skip to content

Commit 63434df

Browse files
committed
format
1 parent 5eb0a0e commit 63434df

22 files changed

+152
-74
lines changed

examples/batch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from qiniu import Auth
55
from qiniu import BucketManager
66
from qiniu import build_batch_copy
7-
from qiniu import build_batch_move,build_batch_rename
7+
from qiniu import build_batch_move, build_batch_rename
88

99
access_key = '...'
1010
secret_key = '...'

examples/batch_copy.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@
2121
target_bucket_name = ''
2222

2323
# force为true时强制同名覆盖, 字典的键为原文件,值为目标文件
24-
ops = build_batch_copy(src_bucket_name, {'src_key1': 'target_key1', 'src_key2': 'target_key2'}, target_bucket_name, force='true')
24+
ops = build_batch_copy(src_bucket_name,
25+
{'src_key1': 'target_key1',
26+
'src_key2': 'target_key2'},
27+
target_bucket_name,
28+
force='true')
2529
ret, info = bucket.batch(ops)
2630
print(info)

examples/batch_move.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@
2222
target_bucket_name = ''
2323

2424
# force为true时强制同名覆盖, 字典的键为原文件,值为目标文件
25-
ops = build_batch_move(src_bucket_name, {'src_key1': 'target_key1', 'src_key2': 'target_key2'}, target_bucket_name, force='true')
25+
ops = build_batch_move(src_bucket_name,
26+
{'src_key1': 'target_key1',
27+
'src_key2': 'target_key2'},
28+
target_bucket_name,
29+
force='true')
2630
ret, info = bucket.batch(ops)
2731
print(info)

examples/batch_rename.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121

2222

2323
# force为true时强制同名覆盖, 字典的键为原文件,值为目标文件
24-
ops = build_batch_rename(bucket_name, {'src_key1': 'target_key1', 'src_key2': 'target_key2'}, force='true')
24+
ops = build_batch_rename(
25+
bucket_name, {
26+
'src_key1': 'target_key1', 'src_key2': 'target_key2'}, force='true')
2527
ret, info = bucket.batch(ops)
2628
print(info)

examples/cdn_bandwidth.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@
2424
'b.example.com'
2525
]
2626

27-
ret, info = cdn_manager.get_bandwidth_data(urls, startDate, endDate, granularity)
27+
ret, info = cdn_manager.get_bandwidth_data(
28+
urls, startDate, endDate, granularity)
2829

2930
print(ret)
3031
print(info)

examples/delete_afte_days.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,3 @@
2222

2323
ret, info = bucket.delete_after_days(bucket_name, key, days)
2424
print(info)
25-
26-

examples/fops.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
# 可以对转码后的文件进行使用saveas参数自定义命名,当然也可以不指定文件会默认命名并保存在当前空间
2121
saveas_key = urlsafe_base64_encode('目标Bucket_Name:自定义文件key')
22-
fops = fops+'|saveas/'+saveas_key
22+
fops = fops + '|saveas/' + saveas_key
2323
ops = []
2424
pfop = PersistentFop(q, bucket_name, pipeline)
2525

examples/pfop_vframe.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@
1919

2020
# 可以对转码后的文件进行使用saveas参数自定义命名,当然也可以不指定文件会默认命名并保存在当前空间
2121
saveas_key = urlsafe_base64_encode('目标Bucket_Name:自定义文件key')
22-
fops = fops+'|saveas/'+saveas_key
22+
fops = fops + '|saveas/' + saveas_key
2323

2424
pfop = PersistentFop(q, bucket, pipeline)
2525
ops = []
2626
ops.append(fops)
2727
ret, info = pfop.execute(key, ops, 1)
2828
print(info)
29-
assert ret['persistentId'] is not None
29+
assert ret['persistentId'] is not None

examples/pfop_watermark.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,18 @@
1515
pipeline = 'pipeline_name'
1616

1717
# 需要添加水印的图片UrlSafeBase64,可以参考http://developer.qiniu.com/code/v6/api/dora-api/av/video-watermark.html
18-
base64URL = urlsafe_base64_encode('http://developer.qiniu.com/resource/logo-2.jpg')
18+
base64URL = urlsafe_base64_encode(
19+
'http://developer.qiniu.com/resource/logo-2.jpg')
1920

2021
# 视频水印参数
21-
fops = 'avthumb/mp4/'+base64URL
22+
fops = 'avthumb/mp4/' + base64URL
2223

2324
# 可以对转码后的文件进行使用saveas参数自定义命名,当然也可以不指定文件会默认命名并保存在当前空间
2425
saveas_key = urlsafe_base64_encode('目标Bucket_Name:自定义文件key')
25-
fops = fops+'|saveas/'+saveas_key
26+
fops = fops + '|saveas/' + saveas_key
2627
ops = []
2728
pfop = PersistentFop(q, bucket, pipeline)
2829
ops.append(fops)
2930
ret, info = pfop.execute(key, ops, 1)
3031
print(info)
31-
assert ret['persistentId']
32+
assert ret['persistentId']

examples/rtc_server.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,8 @@
7777
"appId": "<AppID>:必填", # AppID: 房间所属帐号的 app 。
7878
"roomName": "<房间名>:必填", # RoomName: 房间名称,需满足规格 ^[a-zA-Z0-9_-]{3,64}$
7979
"userId": "<用户名>:必填", # UserID: 请求加入房间的用户 ID,需满足规格 ^[a-zA-Z0-9_-]{3,50}$
80-
"expireAt": int(time.time()) + 3600, # ExpireAt: int64 类型,鉴权的有效时间,传入以秒为单位的64位Unix绝对时间,
80+
# ExpireAt: int64 类型,鉴权的有效时间,传入以秒为单位的64位Unix绝对时间,
81+
"expireAt": int(time.time()) + 3600,
8182
# token 将在该时间后失效。
8283
"permission": "user" # 该用户的房间管理权限,"admin" 或 "user",默认为 "user" 。当权限角色为 "admin" 时,
8384
# 拥有将其他用户移除出房间等特权.

0 commit comments

Comments
 (0)