Skip to content

Commit d902cc9

Browse files
committed
20210803 update 1: fix post search/split/metadata.
1 parent 20e3b73 commit d902cc9

File tree

6 files changed

+29
-37
lines changed

6 files changed

+29
-37
lines changed

README.md

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
![](https://img.shields.io/badge/REST%20API-v3.0-lightgrey) ![PyPI](https://img.shields.io/pypi/v/asposecellscloud) ![PyPI - Python Version](https://img.shields.io/pypi/pyversions/asposecellscloud) ![PyPI - Downloads](https://img.shields.io/pypi/dm/asposecellscloud) [![GitHub license](https://img.shields.io/github/license/aspose-cells-cloud/aspose-cells-cloud-python)](https://github.com/aspose-cells-cloud/aspose-cells-cloud-python/blob/master/LICENSE) ![GitHub commits since latest release (by date)](https://img.shields.io/github/commits-since/aspose-cells-cloud/aspose-cells-cloud-python/21.6)
1+
![](https://img.shields.io/badge/REST%20API-v3.0-lightgrey) ![PyPI](https://img.shields.io/pypi/v/asposecellscloud) ![PyPI - Python Version](https://img.shields.io/pypi/pyversions/asposecellscloud) ![PyPI - Downloads](https://img.shields.io/pypi/dm/asposecellscloud) [![GitHub license](https://img.shields.io/github/license/aspose-cells-cloud/aspose-cells-cloud-python)](https://github.com/aspose-cells-cloud/aspose-cells-cloud-python/blob/master/LICENSE) ![GitHub commits since latest release (by date)](https://img.shields.io/github/commits-since/aspose-cells-cloud/aspose-cells-cloud-python/21.7)
22

33

44
# Python SDK for Spreadsheet Processing in Cloud
@@ -21,16 +21,11 @@ Python Cloud SDK wraps Aspose.Cells REST API so you could seamlessly integrate M
2121
- Convert worksheets to PDF, XPS & SVG formats.
2222
- Inter-convert files to popular Excel formats.
2323

24-
## Feature & Enhancements in Version 21.6
24+
## Feature & Enhancements in Version 21.7
2525

26-
- Improvement document properties.
27-
- Update the return value of put/post/delete.
28-
- Improvement export API.
29-
- Improve split API.
30-
- Improve merge API.
31-
- Improve unlock API.
32-
- Improve protected API.
33-
- Improve watermark API.
26+
- Fix search API.
27+
- Fix split API.
28+
- Fix update metadata API.
3429

3530
## Read & Write Spreadsheet Formats
3631

asposecellscloud/api_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def __init__(self, host=None, header_name=None, header_value=None, cookie=None):
8383
self.host = host
8484
self.cookie = cookie
8585
# Set default User-Agent.
86-
self.user_agent = 'Swagger-Codegen/21.6.1/python'
86+
self.user_agent = 'Swagger-Codegen/21.7/python'
8787

8888
@property
8989
def user_agent(self):

asposecellscloud/apis/lite_cells_api.py

Lines changed: 11 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def __init__(self,clientid, clientsecret, version='v3.0', base_uri= 'https://api
5454
self.api_client = ApiClient(base_uri)
5555
if self.needAuth :
5656
self.access_token = self.api_client.get_access_token("client_credentials", clientid, clientsecret,version)
57-
# self.auth_data = self.o_auth_post("client_credentials", appsid, appkey)
57+
5858
config = Configuration()
5959
config.host = self.base_uri +'/' + self.version
6060
if api_client:
@@ -66,7 +66,7 @@ def __init__(self,clientid, clientsecret, version='v3.0', base_uri= 'https://api
6666
if self.needAuth :
6767
self.api_client.set_default_header("Authorization", "Bearer " + self.access_token)
6868
self.get_access_token_time = time.process_time()
69-
# self.api_client.set_default_header("Authorization", "Bearer " + self.auth_data.access_token)
69+
7070

7171
def check_access_token(self):
7272
if self.needAuth :
@@ -869,7 +869,9 @@ def post_metadata_with_http_info(self, file, document_properties, **kwargs):
869869

870870
body_params = None
871871
if 'document_properties' in params:
872-
body_params = params['document_properties']
872+
# form_params['documentproperties'] = tuple(['documentproperties', self.api_client.sanitize_for_serialization( params['document_properties']), 'application/json'])
873+
form_params.append(tuple(["documentproperties", tuple(["documentproperties",repr(self.api_client.sanitize_for_serialization( params['document_properties'])) , ""])]))
874+
873875
# HTTP header `Accept`
874876
header_params['Accept'] = self.api_client.\
875877
select_header_accept(['multipart/form-data'])
@@ -1028,9 +1030,7 @@ def post_search(self, file, text, **kwargs):
10281030
:param str text: (required)
10291031
:param str password:
10301032
:param str sheetname:
1031-
:param str path:
1032-
:param str storage_name:
1033-
:return: file
1033+
:return: list[TextItem]
10341034
If the method is called asynchronously,
10351035
returns the request thread.
10361036
"""
@@ -1058,14 +1058,12 @@ def post_search_with_http_info(self, file, text, **kwargs):
10581058
:param str text: (required)
10591059
:param str password:
10601060
:param str sheetname:
1061-
:param str path:
1062-
:param str storage_name:
1063-
:return: file
1061+
:return: list[TextItem]
10641062
If the method is called asynchronously,
10651063
returns the request thread.
10661064
"""
10671065

1068-
all_params = ['file', 'text', 'password', 'sheetname', 'path', 'storage_name']
1066+
all_params = ['file', 'text', 'password', 'sheetname']
10691067
all_params.append('callback')
10701068
all_params.append('_return_http_data_only')
10711069
all_params.append('_preload_content')
@@ -1099,10 +1097,7 @@ def post_search_with_http_info(self, file, text, **kwargs):
10991097
query_params.append(('password', params['password']))
11001098
if 'sheetname' in params:
11011099
query_params.append(('sheetname', params['sheetname']))
1102-
if 'path' in params:
1103-
query_params.append(('path', params['path']))
1104-
if 'storage_name' in params:
1105-
query_params.append(('storageName', params['storage_name']))
1100+
11061101

11071102
header_params = {}
11081103

@@ -1136,7 +1131,7 @@ def post_search_with_http_info(self, file, text, **kwargs):
11361131
body=body_params,
11371132
post_params=form_params,
11381133
files=local_var_files,
1139-
response_type='file',
1134+
response_type='list[TextItem]',
11401135
auth_settings=auth_settings,
11411136
callback=params.get('callback'),
11421137
_return_http_data_only=params.get('_return_http_data_only'),
@@ -1161,8 +1156,6 @@ def post_split(self, file, format, **kwargs):
11611156
:param str password:
11621157
:param int _from:
11631158
:param int to:
1164-
:param str path:
1165-
:param str storage_name:
11661159
:return: FilesResult
11671160
If the method is called asynchronously,
11681161
returns the request thread.
@@ -1192,14 +1185,12 @@ def post_split_with_http_info(self, file, format, **kwargs):
11921185
:param str password:
11931186
:param int _from:
11941187
:param int to:
1195-
:param str path:
1196-
:param str storage_name:
11971188
:return: FilesResult
11981189
If the method is called asynchronously,
11991190
returns the request thread.
12001191
"""
12011192

1202-
all_params = ['file', 'format', 'password', '_from', 'to', 'path', 'storage_name']
1193+
all_params = ['file', 'format', 'password', '_from', 'to']
12031194
all_params.append('callback')
12041195
all_params.append('_return_http_data_only')
12051196
all_params.append('_preload_content')
@@ -1235,10 +1226,6 @@ def post_split_with_http_info(self, file, format, **kwargs):
12351226
query_params.append(('from', params['_from']))
12361227
if 'to' in params:
12371228
query_params.append(('to', params['to']))
1238-
if 'path' in params:
1239-
query_params.append(('path', params['path']))
1240-
if 'storage_name' in params:
1241-
query_params.append(('storageName', params['storage_name']))
12421229

12431230
header_params = {}
12441231

asposecellscloud/configuration.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,8 @@ def __init__(self):
101101

102102
# Proxy URL
103103
self.proxy = None
104+
# self.proxy = 'https://127.0.0.1:8888'
105+
# self.ssl_ca_cert = 'C://projects//FiddlerRoot.pem'
104106
# Safe chars for path_param
105107
self.safe_chars_for_path_param = '/'
106108

@@ -254,6 +256,6 @@ def to_debug_report(self):
254256
return "Python SDK Debug Report:\n"\
255257
"OS: {env}\n"\
256258
"Python Version: {pyversion}\n"\
257-
"Version of the API: 21.6.1\n"\
258-
"SDK Package Version: 21.6.1".\
259+
"Version of the API: 21.7\n"\
260+
"SDK Package Version: 21.7".\
259261
format(env=sys.platform, pyversion=sys.version)

test/test_cells_metadata_api.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ def test_cells_update_metadata(self):
3636
documentProperty.name = 'test'
3737
documentProperty.value = 'test'
3838
documentProperties = [documentProperty]
39+
3940
result = self.api.post_metadata({ "assemblytest.xlsx" :assemblytest, "datasource.xlsx":datasource},documentProperties)
4041
# print(result)
4142
pass

test/test_cells_search_api.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,12 @@ def test_cells_search(self):
3434
result = self.api.post_search({ "assemblytest.xlsx" :assemblytest, "datasource.xlsx":datasource},"png")
3535
# print(result)
3636
pass
37+
def test_cells_search_sheet(self):
38+
assemblytest = os.path.dirname(os.path.realpath(__file__)) + "/../TestData/" + "assemblytest.xlsx"
39+
datasource = os.path.dirname(os.path.realpath(__file__)) + "/../TestData/" + "datasource.xlsx"
40+
result = self.api.post_search({ "assemblytest.xlsx" :assemblytest, "datasource.xlsx":datasource},"png",sheetname='Shhet1')
41+
# print(result)
42+
pass
43+
3744
if __name__ == '__main__':
3845
unittest.main()

0 commit comments

Comments
 (0)