Skip to content

Commit 18c900f

Browse files
authored
Merge pull request #5 from NightRain233/master
更换百度统计账号代码
2 parents 35ac882 + f94ca96 commit 18c900f

File tree

5 files changed

+44
-41
lines changed

5 files changed

+44
-41
lines changed

_includes/baidu-analysis.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
var _hmt = _hmt || [];
33
(function() {
44
var hm = document.createElement("script");
5-
hm.src = "https://hm.baidu.com/hm.js?4e6f9af579b843e5d89790505be99d96";
5+
hm.src = "https://hm.baidu.com/hm.js?afbe7ef4655052236c8cb513eb884ed2";
66
var s = document.getElementsByTagName("script")[0];
77
s.parentNode.insertBefore(hm, s);
88
})();

_sass/common/components/_toc.scss

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,14 +86,15 @@ ul.toc--ellipsis {
8686
}
8787
.toc-h2 {
8888
&, a {
89-
font-size:.95rem;
89+
font-size:.96rem;
90+
font-weight: 900;
9091

9192
}
9293
}
9394
.toc-h3 {
9495
&, a {
9596
font-size:.85rem;
96-
97+
font-weight: 500;
9798
}
9899
}
99100
}

collections/_go-sdk/概述.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
---
1+
---
22
title: '概述'
33
sidebar:
44
nav: go-sdk
@@ -26,16 +26,15 @@ sidebar:
2626
| ------------------------------------------------------------ | ------------------------------------------------------------ |
2727
| [demo_context.go](https://github.com/ufilesdk-dev/ufile-gosdk/blob/master/example/demo_context.go) | 为http request 设置 context |
2828
| [demo_bucket.go](https://github.com/ufilesdk-dev/ufile-gosdk/blob/master/example/demo_bucket.go) | 存储空间管理 |
29-
| [demo_file.go](https://github.com/ufilesdk-dev/ufile-gosdk/blob/master/example/demo_file.go) | 文件基本操作,包括普通上传、表单上传、下载、解冻、重命名、复制等 |
29+
| [demo_file.go](https://github.com/ufilesdk-dev/ufile-gosdk/blob/master/example/demo_file.go) | 文件基本操作,包括普通上传、表单上传、同步分片、下载、解冻、重命名、复制等 |
3030
| [demo_io.go](https://github.com/ufilesdk-dev/ufile-gosdk/blob/master/example/demo_io.go) | 流式上传、下载 |
3131
| [demo_iop.go](https://github.com/ufilesdk-dev/ufile-gosdk/blob/master/example/demo_iop.go) | 图片处理 |
3232
| [demo_policy.go](https://github.com/ufilesdk-dev/ufile-gosdk/blob/master/example/demo_policy.go) | 上传后回调 |
33-
| [demo_uploadfile.go](https://github.com/ufilesdk-dev/ufile-gosdk/blob/master/example/demo_uploadfile.go) | 分片上传、下载 |
34-
| [demo_asyncupload.go](https://github.com/ufilesdk-dev/ufile-gosdk/blob/master/example/demo_asyncupload.go) | 异步分片上传、下载 |
35-
| [demo_download.go](https://github.com/ufilesdk-dev/ufile-gosdk/blob/master/example/demo_download.go) | 普通下载 |
36-
| [demo_downloadfile.go](https://github.com/ufilesdk-dev/ufile-gosdk/blob/master/example/demo_downloadfile.go) | 流式下载 |
33+
| [demo_async_mput.go](https://github.com/ufilesdk-dev/ufile-gosdk/blob/master/example/demo_async_mput.go) | 异步分片上传 |
34+
| [demo_async_upload.go](https://github.com/ufilesdk-dev/ufile-gosdk/blob/master/example/demo_async_upload.go) | 异步并发分片上传 |
35+
| [demo_downloadfile.go](https://github.com/ufilesdk-dev/ufile-gosdk/blob/master/example/demo_downloadfile.go) | 文件下载,包括普通下载和流式下载 |
3736
| [demo_storageclass_op.go](https://github.com/ufilesdk-dev/ufile-gosdk/blob/master/example/demo_storegeclass_op.go) | 存储类型转换 |
38-
| [demo_encryption.go](https://github.com/ufilesdk-dev/ufile-gosdk/blob/master/example/demo_encryption.go) | 文件加解密 |
37+
3938

4039

4140

collections/_python-sdk/概述.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,19 @@ sidebar:
1717

1818
| 示例文件 | 示例内容 |
1919
| :----------------------------------------------------------- | :--------------------------------------- |
20-
| [quickstart.py](https://github.com/NightRain233/ufile-sdk-python/blob/master/examples/quickstart.py) | 快速入门,包括上传、下载、遍历、删除文件 |
21-
| [example_bucketmanager.py](https://github.com/NightRain233/ufile-sdk-python/blob/master/examples/example_bucketmanager.py) | 存储空间管理 |
22-
| [example_putfile.py](https://github.com/NightRain233/ufile-sdk-python/blob/master/examples/example_putfile.py) | 普通上传文件 |
23-
| [example_postfile.py](https://github.com/NightRain233/ufile-sdk-python/blob/master/examples/example_postfile.py) | 表单上传文件 |
24-
| [example_uploadhit.py](https://github.com/NightRain233/ufile-sdk-python/blob/master/examples/example_uploadhit.py) | 秒传文件 |
25-
| [example_multipartuploadufile.py](https://github.com/NightRain233/ufile-sdk-python/blob/master/examples/example_multipartuploadufile.py) | 分片上传和断点续传 |
26-
| [example_downloadfile.py](https://github.com/NightRain233/ufile-sdk-python/blob/master/examples/example_downloadfile.py) | 下载文件 |
27-
| [example_headfile.py](https://github.com/NightRain233/ufile-sdk-python/blob/master/examples/example_headfile.py) | 查询文件基本信息 |
28-
| [example_deletefile.py](https://github.com/NightRain233/ufile-sdk-python/blob/master/examples/example_deletefile.py) | 删除文件 |
29-
| [example_restorefile.py](https://github.com/NightRain233/ufile-sdk-python/blob/master/examples/example_restorefile.py) | 解冻归档文件 |
30-
| [example_class_switch_file.py](https://github.com/NightRain233/ufile-sdk-python/blob/master/examples/example_class_switch_file.py) | 文件类型转换 |
31-
| [example_compare_file_etag.py](https://github.com/NightRain233/ufile-sdk-python/blob/master/examples/example_compare_file_etag.py) | 比较本地文件和远程文件etag |
32-
| [example_getfilelist.py](https://github.com/NightRain233/ufile-sdk-python/blob/master/examples/example_getfilelist.py) | 前缀列表查询 |
33-
| [example_listobjects.py](https://github.com/NightRain233/ufile-sdk-python/blob/master/examples/example_listobjects.py) | 获取目录文件列表 |
34-
| [example_copy.py](https://github.com/NightRain233/ufile-sdk-python/blob/master/examples/example_copy.py) | 拷贝文件 |
35-
| [example_rename.py](https://github.com/NightRain233/ufile-sdk-python/blob/master/examples/example_rename.py) | 重命名文件 |
20+
| [quickstart.py](https://github.com/ucloud/ufile-sdk-python/blob/master/examples/quickstart.py) | 快速入门,包括上传、下载、遍历、删除文件 |
21+
| [example_bucketmanager.py](https://github.com/ucloud/ufile-sdk-python/blob/master/examples/example_bucketmanager.py) | 存储空间管理 |
22+
| [example_putfile.py](https://github.com/ucloud/ufile-sdk-python/blob/master/examples/example_putfile.py) | 普通上传文件 |
23+
| [example_postfile.py](https://github.com/ucloud/ufile-sdk-python/blob/master/examples/example_postfile.py) | 表单上传文件 |
24+
| [example_uploadhit.py](https://github.com/ucloud/ufile-sdk-python/blob/master/examples/example_uploadhit.py) | 秒传文件 |
25+
| [example_multipartuploadufile.py](https://github.com/ucloud/ufile-sdk-python/blob/master/examples/example_multipartuploadufile.py) | 分片上传和断点续传 |
26+
| [example_downloadfile.py](https://github.com/ucloud/ufile-sdk-python/blob/master/examples/example_downloadfile.py) | 下载文件 |
27+
| [example_headfile.py](https://github.com/ucloud/ufile-sdk-python/blob/master/examples/example_headfile.py) | 查询文件基本信息 |
28+
| [example_deletefile.py](https://github.com/ucloud/ufile-sdk-python/blob/master/examples/example_deletefile.py) | 删除文件 |
29+
| [example_restorefile.py](https://github.com/ucloud/ufile-sdk-python/blob/master/examples/example_restorefile.py) | 解冻归档文件 |
30+
| [example_class_switch_file.py](https://github.com/ucloud/ufile-sdk-python/blob/master/examples/example_class_switch_file.py) | 文件类型转换 |
31+
| [example_compare_file_etag.py](https://github.com/ucloud/ufile-sdk-python/blob/master/examples/example_compare_file_etag.py) | 比较本地文件和远程文件etag |
32+
| [example_getfilelist.py](https://github.com/ucloud/ufile-sdk-python/blob/master/examples/example_getfilelist.py) | 前缀列表查询 |
33+
| [example_listobjects.py](https://github.com/ucloud/ufile-sdk-python/blob/master/examples/example_listobjects.py) | 获取目录文件列表 |
34+
| [example_copy.py](https://github.com/ucloud/ufile-sdk-python/blob/master/examples/example_copy.py) | 拷贝文件 |
35+
| [example_rename.py](https://github.com/ucloud/ufile-sdk-python/blob/master/examples/example_rename.py) | 重命名文件 |

collections/_python-sdk/获取目录文件列表.md

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -74,17 +74,8 @@ maxkeys=100 #指定返回目录文件列表的最大数量,默认值为100
7474
marker='' #返回以字母排序后,大于marker的目录文件列表
7575
delimiter='/' #delimiter是目录分隔符,当前只支持"/"和"",当Delimiter设置为"/"且prefiex以"/"结尾时,返回prefix目录下的子文件,当delimiter设置为""时,返回以prefix作为前缀的文件
7676

77-
ret, resp = listobjects_hander.listobjects(bucket, prefix=prefix, maxkeys=maxkeys, marker=marker, delimiter=delimiter)
78-
assert resp.status_code == 200
79-
80-
for object in ret['Contents']:#子文件列表
81-
print(object)
82-
83-
for object in ret['CommonPrefixes']:#子目录列表
84-
print(object)
85-
86-
# 根据返回值'NextMarker'循环遍历获得所有结果(若一次查询无法获得所有结果)
87-
while True:
77+
# 普通使用(一次查询即可得到所有结果)
78+
def once_list():
8879
ret, resp = listobjects_hander.listobjects(bucket, prefix=prefix, maxkeys=maxkeys, marker=marker, delimiter=delimiter)
8980
assert resp.status_code == 200
9081

@@ -93,9 +84,21 @@ while True:
9384

9485
for object in ret['CommonPrefixes']:#子目录列表
9586
print(object)
96-
97-
marker = ret['NextMarker']
98-
if len(marker) <= 0 or len(ret['Contents'])+len(ret['CommonPrefixes']) < maxkeys:
99-
break
87+
88+
# 因为一次查询返回数量存在最大限制,所以若一次查询无法获得所有结果,则根据返回值'NextMarker'循环遍历获得所有结果
89+
def loop_list():
90+
while True:
91+
ret, resp = listobjects_hander.listobjects(bucket, prefix=prefix, maxkeys=maxkeys, marker=marker, delimiter=delimiter)
92+
assert resp.status_code == 200
93+
94+
for object in ret['Contents']:#子文件列表
95+
print(object)
96+
97+
for object in ret['CommonPrefixes']:#子目录列表
98+
print(object)
99+
100+
marker = ret['NextMarker']
101+
if len(marker) <= 0 or maxkeys < len(ret['Contents']):
102+
break
100103
{% endhighlight %}
101104
</div>

0 commit comments

Comments
 (0)