Skip to content

Commit 4f836ef

Browse files
Merge branch 'master' into release
2 parents 5688bfa + d16e696 commit 4f836ef

File tree

8 files changed

+66
-8
lines changed

8 files changed

+66
-8
lines changed

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,13 @@ Python Cloud SDK wraps Aspose.Words Cloud API so you could seamlessly integrate
1616
- [Convert a document to desired file format](https://docs.aspose.cloud/display/wordscloud/Convert+Document+to+Destination+Format+with+Detailed+Settings+and+Save+Result+to+Storage) along with detailed settings.
1717
- Convert an encrypted PDF document into Word document format.
1818

19+
## Enhancements in Version 21.6
20+
21+
- Implemented beta version of CompareDocumentOnline feature with both document sending in request
22+
- CompareDocument method now can handle PDF files
23+
- AcceptAllRevisionsBeforeComparison option introduced which is used to specify if accept all revisions before comparison
24+
25+
1926
## Enhancements in Version 21.5
2027

2128
- Update dependencies in sdk

asposewordscloud/api_client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,12 @@ def __init__(self, configuration=None, header_name=None, header_value=None,
8181

8282
self.pool = None
8383
self.rest_client = rest.RESTClientObject(configuration)
84-
self.default_headers = {'x-aspose-client': 'python sdk', 'x-aspose-version': '21.5.1'}
84+
self.default_headers = {'x-aspose-client': 'python sdk', 'x-aspose-version': '21.6'}
8585
if header_name is not None:
8686
self.default_headers[header_name] = header_value
8787
self.cookie = cookie
8888
# Set default User-Agent.
89-
self.user_agent = 'python sdk 21.5.1'
89+
self.user_agent = 'python sdk 21.6'
9090

9191
def __del__(self):
9292
if not self.pool is None:

asposewordscloud/apis/words_api.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -985,6 +985,7 @@ def compare_document_online(self, request, **kwargs): # noqa: E501
985985
:param is_async bool
986986
:param document file : The document. (required)
987987
:param compare_data CompareData : Compare data. (required)
988+
:param comparing_document file : The comparing document.
988989
:param load_encoding str : Encoding that will be used to load an HTML (or TXT) document if the encoding is not specified in HTML.
989990
:param password str : Password for opening an encrypted document.
990991
:param dest_file_name str : Result path of the document after the operation. If this parameter is omitted then result of the operation will be saved as the source document.

asposewordscloud/configuration.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,6 @@ def to_debug_report(self):
258258
return "Python SDK Debug Report:\n"\
259259
"OS: {env}\n"\
260260
"Python Version: {pyversion}\n"\
261-
"Version of the API: 21.5.1\n"\
262-
"SDK Package Version: 21.5.1".\
261+
"Version of the API: 21.6\n"\
262+
"SDK Package Version: 21.6".\
263263
format(env=sys.platform, pyversion=sys.version)

asposewordscloud/models/compare_options.py

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ class CompareOptions(object):
4343
and the value is json key in definition.
4444
"""
4545
swagger_types = {
46+
'accept_all_revisions_before_comparison': 'bool',
4647
'ignore_case_changes': 'bool',
4748
'ignore_comments': 'bool',
4849
'ignore_fields': 'bool',
@@ -55,6 +56,7 @@ class CompareOptions(object):
5556
}
5657

5758
attribute_map = {
59+
'accept_all_revisions_before_comparison': 'AcceptAllRevisionsBeforeComparison',
5860
'ignore_case_changes': 'IgnoreCaseChanges',
5961
'ignore_comments': 'IgnoreComments',
6062
'ignore_fields': 'IgnoreFields',
@@ -66,9 +68,10 @@ class CompareOptions(object):
6668
'target': 'Target'
6769
}
6870

69-
def __init__(self, ignore_case_changes=None, ignore_comments=None, ignore_fields=None, ignore_footnotes=None, ignore_formatting=None, ignore_headers_and_footers=None, ignore_tables=None, ignore_textboxes=None, target=None): # noqa: E501
71+
def __init__(self, accept_all_revisions_before_comparison=None, ignore_case_changes=None, ignore_comments=None, ignore_fields=None, ignore_footnotes=None, ignore_formatting=None, ignore_headers_and_footers=None, ignore_tables=None, ignore_textboxes=None, target=None): # noqa: E501
7072
"""CompareOptions - a model defined in Swagger""" # noqa: E501
7173

74+
self._accept_all_revisions_before_comparison = None
7275
self._ignore_case_changes = None
7376
self._ignore_comments = None
7477
self._ignore_fields = None
@@ -80,6 +83,8 @@ def __init__(self, ignore_case_changes=None, ignore_comments=None, ignore_fields
8083
self._target = None
8184
self.discriminator = None
8285

86+
if accept_all_revisions_before_comparison is not None:
87+
self.accept_all_revisions_before_comparison = accept_all_revisions_before_comparison
8388
if ignore_case_changes is not None:
8489
self.ignore_case_changes = ignore_case_changes
8590
if ignore_comments is not None:
@@ -99,6 +104,28 @@ def __init__(self, ignore_case_changes=None, ignore_comments=None, ignore_fields
99104
if target is not None:
100105
self.target = target
101106

107+
@property
108+
def accept_all_revisions_before_comparison(self):
109+
"""Gets the accept_all_revisions_before_comparison of this CompareOptions. # noqa: E501
110+
111+
Gets or sets whether accept revisions before comparison or not. # noqa: E501
112+
113+
:return: The accept_all_revisions_before_comparison of this CompareOptions. # noqa: E501
114+
:rtype: bool
115+
"""
116+
return self._accept_all_revisions_before_comparison
117+
118+
@accept_all_revisions_before_comparison.setter
119+
def accept_all_revisions_before_comparison(self, accept_all_revisions_before_comparison):
120+
"""Sets the accept_all_revisions_before_comparison of this CompareOptions.
121+
122+
Gets or sets whether accept revisions before comparison or not. # noqa: E501
123+
124+
:param accept_all_revisions_before_comparison: The accept_all_revisions_before_comparison of this CompareOptions. # noqa: E501
125+
:type: bool
126+
"""
127+
self._accept_all_revisions_before_comparison = accept_all_revisions_before_comparison
128+
102129
@property
103130
def ignore_case_changes(self):
104131
"""Gets the ignore_case_changes of this CompareOptions. # noqa: E501

asposewordscloud/models/requests/compare_document_online_request.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,16 @@ class CompareDocumentOnlineRequest(BaseRequestObject):
3636
Initializes a new instance.
3737
:param document The document.
3838
:param compare_data Compare data.
39+
:param comparing_document The comparing document.
3940
:param load_encoding Encoding that will be used to load an HTML (or TXT) document if the encoding is not specified in HTML.
4041
:param password Password for opening an encrypted document.
4142
:param dest_file_name Result path of the document after the operation. If this parameter is omitted then result of the operation will be saved as the source document.
4243
"""
4344

44-
def __init__(self, document, compare_data, load_encoding=None, password=None, dest_file_name=None):
45+
def __init__(self, document, compare_data, comparing_document=None, load_encoding=None, password=None, dest_file_name=None):
4546
self.document = document
4647
self.compare_data = compare_data
48+
self.comparing_document = comparing_document
4749
self.load_encoding = load_encoding
4850
self.password = password
4951
self.dest_file_name = dest_file_name
@@ -92,6 +94,8 @@ def create_http_request(self, api_client):
9294
form_params.append(['document', self.document, 'file']) # noqa: E501
9395
if self.compare_data is not None:
9496
form_params.append(['compareData', self.compare_data.to_json(), 'string']) # noqa: E501
97+
if self.comparing_document is not None:
98+
form_params.append(['comparingDocument', self.comparing_document, 'file']) # noqa: E501
9599

96100
body_params = None
97101
return {

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
66
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
77
8-
OpenAPI spec version: 21.5.1
8+
OpenAPI spec version: 21.6
99
1010
Generated by: https://github.com/swagger-api/swagger-codegen.git
1111
"""
@@ -14,7 +14,7 @@
1414
from setuptools import setup, find_packages # noqa: H301
1515

1616
NAME = "aspose-words-cloud"
17-
VERSION = "21.5.1.0"
17+
VERSION = "21.6.0"
1818
# To install the library, run the following
1919
#
2020
# python setup.py install

test/api/document/test_compare_document.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,3 +72,22 @@ def test_compare_document_online(self):
7272
result = self.words_api.compare_document_online(request)
7373
self.assertIsNotNone(result, 'Error has occurred.')
7474

75+
76+
#
77+
# Test for document comparison online.
78+
#
79+
def test_compare_two_document_online(self):
80+
remote_folder = self.remote_test_folder + '/DocumentActions/CompareDocument'
81+
local_folder = 'DocumentActions/CompareDocument'
82+
local_name1 = 'compareTestDoc1.doc'
83+
local_name2 = 'compareTestDoc2.doc'
84+
remote_name2 = 'TestCompareDocument2.doc'
85+
86+
self.upload_file(remote_folder + '/' + remote_name2, open(os.path.join(self.local_test_folder, local_folder + '/' + local_name2), 'rb'))
87+
88+
request_compare_data = asposewordscloud.CompareData(author = 'author', comparing_with_document = remote_folder + '/' + remote_name2, date_time = dateutil.parser.isoparse('2015-10-26T00:00:00.0000000Z'))
89+
request = asposewordscloud.models.requests.CompareDocumentOnlineRequest(document = open(os.path.join(self.local_test_folder, local_folder + '/' + local_name1), 'rb'), compare_data = request_compare_data, comparing_document = open(os.path.join(self.local_test_folder, local_folder + '/' + local_name2), 'rb'), dest_file_name = self.remote_test_out + '/TestCompareDocumentOut.doc')
90+
91+
result = self.words_api.compare_document_online(request)
92+
self.assertIsNotNone(result, 'Error has occurred.')
93+

0 commit comments

Comments
 (0)