Skip to content

Commit 8090ab4

Browse files
zhuxiaolong37huiguangjun
authored andcommitted
fix comment
1 parent 1712889 commit 8090ab4

File tree

16 files changed

+79
-77
lines changed

16 files changed

+79
-77
lines changed

alibabacloud_oss_v2/checkpoint.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
# }
4747

4848
class DownloadCheckpoint:
49-
"""_summary_
49+
"""Download Checkpoint
5050
"""
5151
def __init__(
5252
self,
@@ -189,7 +189,7 @@ def _is_valid(self) -> bool:
189189
return False
190190

191191
def dump(self) -> bool:
192-
"""_summary_
192+
"""dump
193193
194194
Returns:
195195
_type_: _description_
@@ -247,7 +247,7 @@ def remove(self) -> None:
247247
# }
248248

249249
class UploadCheckpoint:
250-
"""_summary_
250+
"""Upload Checkpoint
251251
"""
252252
def __init__(
253253
self,
@@ -352,7 +352,7 @@ def _is_valid(self) -> bool:
352352
return False
353353

354354
def dump(self) -> bool:
355-
"""_summary_
355+
"""dump
356356
357357
Returns:
358358
_type_: _description_
@@ -377,7 +377,7 @@ def dump(self) -> bool:
377377
return True
378378

379379
def remove(self) -> None:
380-
"""_summary_
380+
"""remove
381381
"""
382382
try:
383383
os.remove(self.cp_filepath)

alibabacloud_oss_v2/client.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# pylint: disable=line-too-long
2-
"""_summary_"""
2+
"""Client used to interact with **Alibaba Cloud Object Storage Service (OSS)**."""
33
import copy
44
from typing import Optional
55
from .config import Config
@@ -29,11 +29,11 @@
2929
from .filelike import AppendOnlyFile, ReadOnlyFile
3030

3131
class Client:
32-
"""_summary_
32+
"""Client
3333
"""
3434

3535
def __init__(self, config: Config, **kwargs) -> None:
36-
"""_summary_
36+
"""Initialize Client
3737
3838
Args:
3939
config (Config): _description_
@@ -45,7 +45,7 @@ def __repr__(self) -> str:
4545

4646
def invoke_operation(self, op_input: OperationInput, **kwargs
4747
) -> OperationOutput:
48-
"""_summary_
48+
"""invoke operation
4949
5050
Args:
5151
op_input (OperationInput): _description_
@@ -679,7 +679,7 @@ def list_multipart_uploads_paginator(self, **kwargs) -> ListMultipartUploadsPagi
679679

680680
# transfer managers
681681
def downloader(self, **kwargs) -> Downloader:
682-
"""_summary_
682+
"""downloader
683683
684684
Args:
685685
@@ -689,7 +689,7 @@ def downloader(self, **kwargs) -> Downloader:
689689
return Downloader(self, **kwargs)
690690

691691
def uploader(self, **kwargs) -> Uploader:
692-
"""_summary_
692+
"""uploader
693693
694694
Returns:
695695
Uploader: _description_
@@ -818,7 +818,7 @@ def is_bucket_exist(self, bucket: str, request_payer: Optional[str] = None, **kw
818818
return result is not None
819819

820820
def put_object_from_file(self, request: models.PutObjectRequest, filepath: str, **kwargs) -> models.PutObjectResult:
821-
"""_summary_
821+
"""put object from file
822822
823823
Args:
824824
request (models.PutObjectRequest): _description_
@@ -833,7 +833,7 @@ def put_object_from_file(self, request: models.PutObjectRequest, filepath: str,
833833
return self.put_object(req, **kwargs)
834834

835835
def get_object_to_file(self, request: models.GetObjectRequest, filepath: str, **kwargs) -> models.GetObjectResult:
836-
"""_summary_
836+
"""get object to file
837837
838838
Args:
839839
request (models.GetObjectRequest): _description_

alibabacloud_oss_v2/crc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ def write(self, data: bytes):
225225

226226
@staticmethod
227227
def combine(crc1, crc2, size) -> int:
228-
"""_summary_
228+
"""combine
229229
230230
Args:
231231
crc1 (_type_): _description_

alibabacloud_oss_v2/crypto/aes_ctr.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def _iv_to_big_int(iv: bytes) -> int:
1717
return iv_big_int
1818

1919
class IteratorEncryptor():
20-
"""_summary_
20+
"""Iterator Encryptor
2121
"""
2222

2323
def __init__(
@@ -73,7 +73,7 @@ def __next__(self):
7373
raise err
7474

7575
class IterableEncryptor():
76-
"""_summary_
76+
"""Iterable Encryptor
7777
"""
7878

7979
def __init__(
@@ -93,7 +93,7 @@ def __iter__(self):
9393
counter=self._counter)
9494

9595
class FileLikeEncryptor():
96-
"""_summary_
96+
"""File Like Encryptor
9797
"""
9898
def __init__(
9999
self,
@@ -109,7 +109,7 @@ def __init__(
109109
self._offset = offset
110110

111111
def read(self, n: int = -1) -> AnyStr:
112-
"""_summary_
112+
"""read
113113
114114
Args:
115115
n (int, optional): _description_. Defaults to -1.
@@ -131,7 +131,7 @@ def read(self, n: int = -1) -> AnyStr:
131131
return self._cipher.encrypt(self._reader.read(n))
132132

133133
def seek(self, offset: int, whence: int = 0) -> int:
134-
"""_summary_
134+
"""seek
135135
136136
Args:
137137
offset (int): _description_
@@ -149,13 +149,13 @@ def seek(self, offset: int, whence: int = 0) -> int:
149149
return offset
150150

151151
def tell(self) -> int:
152-
"""_summary_
152+
"""tell
153153
"""
154154
return self._reader.tell()
155155

156156

157157
class StreamBodyDecryptor(StreamBody):
158-
"""_summary_
158+
"""Stream Body Decryptor
159159
"""
160160
def __init__(
161161
self,
@@ -219,7 +219,7 @@ def __init__(
219219
self.no_str = False
220220

221221
def encrypt(self, src: Any) -> Any:
222-
"""_summary_
222+
"""encrypt data
223223
224224
Args:
225225
src (Any): _description_
@@ -246,7 +246,7 @@ def encrypt(self, src: Any) -> Any:
246246
raise TypeError(f'src is not str/bytes/file-like/Iterable type, got {type(src)}')
247247

248248
def decrypt(self, src: Any) -> Any:
249-
"""_summary_
249+
"""decrypt data
250250
251251
Args:
252252
src (Any): _description_
@@ -268,7 +268,7 @@ def _get_cipher(self):
268268

269269
@staticmethod
270270
def random_key() -> bytes:
271-
"""_summary_
271+
"""random key
272272
273273
Returns:
274274
bytes: _description_
@@ -277,7 +277,7 @@ def random_key() -> bytes:
277277

278278
@staticmethod
279279
def random_iv() -> bytes:
280-
"""_summary_
280+
"""random iv
281281
282282
Returns:
283283
bytes: _description_

alibabacloud_oss_v2/crypto/aes_ctr_cipher.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,18 @@ def __init__(
1919
self._cipher = _AesCtr(cipher_data, offset)
2020

2121
def encrypt_content(self, data: Any) -> Any:
22-
"""_summary_
22+
"""encrypt content
2323
"""
2424
return self._cipher.encrypt(data)
2525

2626
def decrypt_content(self, data: Any) -> Any:
27-
"""_summary_
27+
"""decrypt content
2828
"""
2929
reader = self._cipher.decrypt(data)
3030
return reader
3131

3232
def clone(self, **kwargs) -> ContentCipher:
33-
"""_summary_
33+
"""clone
3434
"""
3535
return _AESCtrCipher(
3636
cipher_data=self._cipher_data,
@@ -50,7 +50,7 @@ def get_align_len(self) -> int:
5050

5151

5252
class AESCtrCipherBuilder(ContentCipherBuilder):
53-
"""_summary_
53+
"""AES Ctr Cipher Builder
5454
5555
Args:
5656
ContentCipherBuilder (_type_): _description_

alibabacloud_oss_v2/crypto/cipher.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ class Encrypter(abc.ABC):
66

77
@abc.abstractmethod
88
def encrypt(self, reader: Any) -> Any:
9-
"""_summary_
9+
"""encrypt
1010
"""
1111

1212

@@ -15,9 +15,9 @@ class Decrypter(abc.ABC):
1515

1616
@abc.abstractmethod
1717
def decrypt(self, reader: Any) -> Any:
18-
"""_summary_
18+
"""decrypt
1919
"""
2020

2121
class Cipher(Encrypter, Decrypter):
22-
"""_summary_
22+
"""Cipher
2323
"""

alibabacloud_oss_v2/crypto/types.py

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,55 +9,55 @@ class MasterCipher(abc.ABC):
99

1010
@abc.abstractmethod
1111
def encrypt(self, data: bytes) -> bytes:
12-
"""_summary_
12+
"""encrypt data
1313
"""
1414

1515
@abc.abstractmethod
1616
def decrypt(self, data: bytes) -> bytes:
17-
"""_summary_
17+
"""decrypt data
1818
"""
1919

2020
@abc.abstractmethod
2121
def get_wrap_algorithm(self) -> str:
22-
"""_summary_
22+
"""get wrap algorithm
2323
"""
2424

2525
@abc.abstractmethod
2626
def get_mat_desc(self) -> str:
27-
"""_summary_
27+
"""get mat desc
2828
"""
2929

3030
class ContentCipher(abc.ABC):
3131
"""Base abstract base class to encrypt or decrpt object's data"""
3232

3333
@abc.abstractmethod
3434
def encrypt_content(self, data: Any) -> Any:
35-
"""_summary_
35+
"""encrypt content
3636
"""
3737

3838
@abc.abstractmethod
3939
def decrypt_content(self, data: Any) -> Any:
40-
"""_summary_
40+
"""decrypt content
4141
"""
4242

4343
@abc.abstractmethod
4444
def clone(self, **kwargs) -> "ContentCipher":
45-
"""_summary_
45+
"""clone
4646
"""
4747

4848
@abc.abstractmethod
4949
def get_encrypted_len(self, plain_text_len: int) -> int:
50-
"""_summary_
50+
"""get encrypted len
5151
"""
5252

5353
@abc.abstractmethod
5454
def get_cipher_data(self) -> "CipherData":
55-
"""_summary_
55+
"""get cipher data
5656
"""
5757

5858
@abc.abstractmethod
5959
def get_align_len(self) -> int:
60-
"""_summary_
60+
"""get align len
6161
"""
6262

6363

@@ -83,7 +83,7 @@ def __init__(
8383
self.unencrypted_content_length = unencrypted_content_length
8484

8585
def is_valid(self) -> bool:
86-
"""_summary_
86+
"""is valid
8787
8888
Returns:
8989
bool: _description_
@@ -95,7 +95,7 @@ def is_valid(self) -> bool:
9595

9696

9797
def random_key_iv(self):
98-
"""_summary_
98+
"""random key iv
9999
"""
100100

101101
class CipherData:
@@ -120,15 +120,15 @@ def __init__(
120120
self.cek_algorithm = cek_algorithm
121121

122122
def clone(self) -> "CipherData":
123-
"""_summary_
123+
"""clone
124124
125125
Returns:
126126
CipherData: _description_
127127
"""
128128
return copy.deepcopy(self)
129129

130130
def random_key_iv(self):
131-
"""_summary_
131+
"""random key iv
132132
"""
133133

134134

@@ -137,15 +137,15 @@ class ContentCipherBuilder(abc.ABC):
137137

138138
@abc.abstractmethod
139139
def content_cipher(self) -> ContentCipher:
140-
"""_summary_
140+
"""content cipher
141141
"""
142142

143143
@abc.abstractmethod
144144
def content_cipher_from_env(self, env: Envelope, **kwargs) -> ContentCipher:
145-
"""_summary_
145+
"""content cipher from env
146146
"""
147147

148148
@abc.abstractmethod
149149
def get_mat_desc(self) -> str:
150-
"""_summary_
150+
"""get mat desc
151151
"""

0 commit comments

Comments
 (0)