Skip to content

Commit bb151f8

Browse files
authored
Release 23.2 (#54)
* Cloud Release 23.2 * Fix AttributeError: 'RESTResponse' object has no attribute 'headers'
1 parent f1b9732 commit bb151f8

16 files changed

Lines changed: 88 additions & 42 deletions

Makefile

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ init:
4141

4242
.PHONY: init-docker
4343
init-docker:
44-
python3 -m pip install -r publish-requirements.txt
44+
python3 -m pip install -r publish-requirements.txt -r requirements.txt
4545

4646
.PHONY: lint
4747
lint:
@@ -55,16 +55,20 @@ publish: check_git test-tox dist
5555
python3 -m twine upload dist/*
5656

5757
.PHONY: publish-docker
58-
publish-docker: init-docker test-tox dist
58+
publish-docker: init-docker unittest dist
5959
python3 -m twine upload dist/* --verbose
6060

6161
.PHONY: test
6262
test:
63-
python -Werror -m pytest --cov tests/
63+
python -Werror -m pytest --cov=aspose_barcode_cloud tests/
64+
65+
.PHONY: cover
66+
cover:
67+
python -Werror -m pytest --cov-report html:coverage --cov=aspose_barcode_cloud tests/
6468

6569
.PHONY: unittest
6670
unittest:
67-
python -Werror -m unittest discover -v
71+
python3 -Werror -m unittest discover -v
6872

6973
.PHONY: test-example
7074
test-example:

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
[![PyPI](https://img.shields.io/pypi/v/aspose-barcode-cloud)](https://pypi.org/project/aspose-barcode-cloud/)
66

77
- API version: 3.0
8-
- Package version: 23.1.0
8+
- Package version: 23.2.0
99

1010
## Demo applications
1111

@@ -115,7 +115,7 @@ Class | Method | HTTP request | Description
115115
----- | ------ | ------------ | -----------
116116
*BarcodeApi* | [**get_barcode_generate**](docs/BarcodeApi.md#get_barcode_generate) | **GET** /barcode/generate | Generate barcode.
117117
*BarcodeApi* | [**get_barcode_recognize**](docs/BarcodeApi.md#get_barcode_recognize) | **GET** /barcode/{name}/recognize | Recognize barcode from a file on server.
118-
*BarcodeApi* | [**post_barcode_recognize_from_url_or_content**](docs/BarcodeApi.md#post_barcode_recognize_from_url_or_content) | **POST** /barcode/recognize | Recognize barcode from an url or from request body. Request body can contain raw data bytes of the image or encoded with base64.
118+
*BarcodeApi* | [**post_barcode_recognize_from_url_or_content**](docs/BarcodeApi.md#post_barcode_recognize_from_url_or_content) | **POST** /barcode/recognize | Recognize barcode from an url or from request body. Request body can contain raw data bytes of the image with content-type \"application/octet-stream\". An image can also be passed as a form field.
119119
*BarcodeApi* | [**post_generate_multiple**](docs/BarcodeApi.md#post_generate_multiple) | **POST** /barcode/generateMultiple | Generate multiple barcodes and return in response stream
120120
*BarcodeApi* | [**put_barcode_generate_file**](docs/BarcodeApi.md#put_barcode_generate_file) | **PUT** /barcode/{name}/generate | Generate barcode and save on server (from query params or from file with json or xml content)
121121
*BarcodeApi* | [**put_barcode_recognize_from_body**](docs/BarcodeApi.md#put_barcode_recognize_from_body) | **PUT** /barcode/{name}/recognize | Recognition of a barcode from file on server with parameters in body.

aspose_barcode_cloud/api/barcode_api.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,7 @@ def get_barcode_recognize(
458458
:param int rect_width: Set Width of area for recognition. # noqa: E501
459459
:param int rect_height: Set Height of area for recognition. # noqa: E501
460460
:param bool strip_fnc: Value indicating whether FNC symbol strip must be done. # noqa: E501
461-
:param int timeout: Timeout of recognition process. # noqa: E501
461+
:param int timeout: Timeout of recognition process in milliseconds. Default value is 15_000 (15 seconds). In case of a timeout RequestTimeout (408) status will be returned. Try reducing the image size to avoid timeout. # noqa: E501
462462
:param int median_smoothing_window_size: Window size for median smoothing. Typical values are 3 or 4. Default value is 3. AllowMedianSmoothing must be set. # noqa: E501
463463
:param bool allow_median_smoothing: Allows engine to enable median smoothing as additional scan. Mode helps to recognize noised barcodes. # noqa: E501
464464
:param bool allow_complex_background: Allows engine to recognize color barcodes on color background as additional scan. Extremely slow mode. # noqa: E501
@@ -482,7 +482,7 @@ def get_barcode_recognize(
482482
:param bool skip_diagonal_search: Allows detector to skip search for diagonal barcodes. Setting it to false will increase detection time but allow to find diagonal barcodes that can be missed otherwise. Enabling of diagonal search leads to a bigger detection time. # noqa: E501
483483
:param bool read_tiny_barcodes: Allows engine to recognize tiny barcodes on large images. Ignored if AllowIncorrectBarcodes is set to True. Default value: False. # noqa: E501
484484
:param str australian_post_encoding_table: Interpreting Type for the Customer Information of AustralianPost BarCode.Default is CustomerInformationInterpretingType.Other. # noqa: E501
485-
:param bool ignore_ending_filling_patterns_for_c_table: The flag which force AustraliaPost decoder to ignore last filling patterns in Customer Information Field during decoding as CTable method. CTable encoding method does not have any gaps in encoding table and sequnce \"333\" of filling paterns is decoded as letter \"z\". # noqa: E501
485+
:param bool ignore_ending_filling_patterns_for_c_table: The flag which force AustraliaPost decoder to ignore last filling patterns in Customer Information Field during decoding as CTable method. CTable encoding method does not have any gaps in encoding table and sequence \"333\" of filling patterns is decoded as letter \"z\". # noqa: E501
486486
:param str rectangle_region: # noqa: E501
487487
:param str storage: The image storage. # noqa: E501
488488
:param str folder: The image folder. # noqa: E501
@@ -810,7 +810,7 @@ def post_barcode_recognize_from_url_or_content(
810810
async_req=False,
811811
**kwargs
812812
):
813-
"""Recognize barcode from an url or from request body. Request body can contain raw data bytes of the image or encoded with base64.
813+
"""Recognize barcode from an url or from request body. Request body can contain raw data bytes of the image with content-type \"application/octet-stream\". An image can also be passed as a form field.
814814
815815
This method makes a synchronous HTTP request by default. To make an
816816
asynchronous HTTP request, please pass async_req=True
@@ -826,7 +826,7 @@ def post_barcode_recognize_from_url_or_content(
826826
:param int rect_width: Set Width of area for recognition. # noqa: E501
827827
:param int rect_height: Set Height of area for recognition. # noqa: E501
828828
:param bool strip_fnc: Value indicating whether FNC symbol strip must be done. # noqa: E501
829-
:param int timeout: Timeout of recognition process. # noqa: E501
829+
:param int timeout: Timeout of recognition process in milliseconds. Default value is 15_000 (15 seconds). In case of a timeout RequestTimeout (408) status will be returned. Try reducing the image size to avoid timeout. # noqa: E501
830830
:param int median_smoothing_window_size: Window size for median smoothing. Typical values are 3 or 4. Default value is 3. AllowMedianSmoothing must be set. # noqa: E501
831831
:param bool allow_median_smoothing: Allows engine to enable median smoothing as additional scan. Mode helps to recognize noised barcodes. # noqa: E501
832832
:param bool allow_complex_background: Allows engine to recognize color barcodes on color background as additional scan. Extremely slow mode. # noqa: E501
@@ -850,7 +850,7 @@ def post_barcode_recognize_from_url_or_content(
850850
:param bool skip_diagonal_search: Allows detector to skip search for diagonal barcodes. Setting it to false will increase detection time but allow to find diagonal barcodes that can be missed otherwise. Enabling of diagonal search leads to a bigger detection time. # noqa: E501
851851
:param bool read_tiny_barcodes: Allows engine to recognize tiny barcodes on large images. Ignored if AllowIncorrectBarcodes is set to True. Default value: False. # noqa: E501
852852
:param str australian_post_encoding_table: Interpreting Type for the Customer Information of AustralianPost BarCode.Default is CustomerInformationInterpretingType.Other. # noqa: E501
853-
:param bool ignore_ending_filling_patterns_for_c_table: The flag which force AustraliaPost decoder to ignore last filling patterns in Customer Information Field during decoding as CTable method. CTable encoding method does not have any gaps in encoding table and sequnce \"333\" of filling paterns is decoded as letter \"z\". # noqa: E501
853+
:param bool ignore_ending_filling_patterns_for_c_table: The flag which force AustraliaPost decoder to ignore last filling patterns in Customer Information Field during decoding as CTable method. CTable encoding method does not have any gaps in encoding table and sequence \"333\" of filling patterns is decoded as letter \"z\". # noqa: E501
854854
:param str rectangle_region: # noqa: E501
855855
:param str url: The image file url. # noqa: E501
856856
:param file image: Image data # noqa: E501
@@ -945,7 +945,7 @@ def post_barcode_recognize_from_url_or_content(
945945
return data
946946

947947
def post_barcode_recognize_from_url_or_content_with_http_info(self, **kwargs):
948-
"""Recognize barcode from an url or from request body. Request body can contain raw data bytes of the image or encoded with base64.
948+
"""Recognize barcode from an url or from request body. Request body can contain raw data bytes of the image with content-type \"application/octet-stream\". An image can also be passed as a form field.
949949
950950
This method makes a synchronous HTTP request by default. To make an
951951
asynchronous HTTP request, please pass async_req=True

aspose_barcode_cloud/api_client.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,13 +90,13 @@ def __init__(self, configuration=None, header_name=None, header_value=None, cook
9090
self.rest_client = RESTClientObject(configuration)
9191
self.default_headers = {
9292
"x-aspose-client": "python sdk",
93-
"x-aspose-client-version": "23.1.0",
93+
"x-aspose-client-version": "23.2.0",
9494
}
9595
if header_name is not None:
9696
self.default_headers[header_name] = header_value
9797
self.cookie = cookie
9898
# Set default User-Agent.
99-
self.user_agent = "Aspose-Barcode-SDK/23.1.0/python"
99+
self.user_agent = "Aspose-Barcode-SDK/23.2.0/python"
100100

101101
def __del__(self):
102102
self.rest_client.close()
@@ -139,7 +139,6 @@ def __call_api(
139139
_preload_content=True,
140140
_request_timeout=None,
141141
):
142-
143142
config = self.configuration
144143

145144
# header parameters
@@ -206,7 +205,7 @@ def __call_api(
206205
if _return_http_data_only:
207206
return return_data
208207
else:
209-
return (return_data, response_data.status, response_data.getheaders())
208+
return return_data, response_data.status, response_data.getheaders()
210209

211210
def sanitize_for_serialization(self, obj):
212211
"""Builds a JSON POST object.

aspose_barcode_cloud/configuration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ def to_debug_report(self):
286286
"OS: {env}\n"
287287
"Python Version: {pyversion}\n"
288288
"Version of the API: 3.0\n"
289-
"SDK Package Version: 23.1.0".format(env=sys.platform, pyversion=sys.version)
289+
"SDK Package Version: 23.2.0".format(env=sys.platform, pyversion=sys.version)
290290
)
291291

292292
@staticmethod

aspose_barcode_cloud/models/reader_params.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,7 @@ def strip_fnc(self, strip_fnc):
473473
def timeout(self):
474474
"""Gets the timeout of this ReaderParams. # noqa: E501
475475
476-
Timeout of recognition process. # noqa: E501
476+
Timeout of recognition process in milliseconds. Default value is 15_000 (15 seconds). In case of a timeout RequestTimeout (408) status will be returned. Try reducing the image size to avoid timeout. # noqa: E501
477477
478478
:return: The timeout of this ReaderParams. # noqa: E501
479479
:rtype: int
@@ -484,7 +484,7 @@ def timeout(self):
484484
def timeout(self, timeout):
485485
"""Sets the timeout of this ReaderParams.
486486
487-
Timeout of recognition process. # noqa: E501
487+
Timeout of recognition process in milliseconds. Default value is 15_000 (15 seconds). In case of a timeout RequestTimeout (408) status will be returned. Try reducing the image size to avoid timeout. # noqa: E501
488488
489489
:param timeout: The timeout of this ReaderParams. # noqa: E501
490490
:type: int
@@ -1025,7 +1025,7 @@ def australian_post_encoding_table(self, australian_post_encoding_table):
10251025
def ignore_ending_filling_patterns_for_c_table(self):
10261026
"""Gets the ignore_ending_filling_patterns_for_c_table of this ReaderParams. # noqa: E501
10271027
1028-
The flag which force AustraliaPost decoder to ignore last filling patterns in Customer Information Field during decoding as CTable method. CTable encoding method does not have any gaps in encoding table and sequnce \"333\" of filling paterns is decoded as letter \"z\". # noqa: E501
1028+
The flag which force AustraliaPost decoder to ignore last filling patterns in Customer Information Field during decoding as CTable method. CTable encoding method does not have any gaps in encoding table and sequence \"333\" of filling patterns is decoded as letter \"z\". # noqa: E501
10291029
10301030
:return: The ignore_ending_filling_patterns_for_c_table of this ReaderParams. # noqa: E501
10311031
:rtype: bool
@@ -1036,7 +1036,7 @@ def ignore_ending_filling_patterns_for_c_table(self):
10361036
def ignore_ending_filling_patterns_for_c_table(self, ignore_ending_filling_patterns_for_c_table):
10371037
"""Sets the ignore_ending_filling_patterns_for_c_table of this ReaderParams.
10381038
1039-
The flag which force AustraliaPost decoder to ignore last filling patterns in Customer Information Field during decoding as CTable method. CTable encoding method does not have any gaps in encoding table and sequnce \"333\" of filling paterns is decoded as letter \"z\". # noqa: E501
1039+
The flag which force AustraliaPost decoder to ignore last filling patterns in Customer Information Field during decoding as CTable method. CTable encoding method does not have any gaps in encoding table and sequence \"333\" of filling patterns is decoded as letter \"z\". # noqa: E501
10401040
10411041
:param ignore_ending_filling_patterns_for_c_table: The ignore_ending_filling_patterns_for_c_table of this ReaderParams. # noqa: E501
10421042
:type: bool

aspose_barcode_cloud/rest.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -390,18 +390,14 @@ def __init__(self, status=0, reason=None, http_resp=None):
390390
self.status = http_resp.status
391391
self.reason = http_resp.reason
392392
self.body = http_resp.data
393-
self.headers = http_resp.headers
394393
else:
395394
self.status = status
396395
self.reason = reason
397396
self.body = None
398-
self.headers = None
399397

400398
def __str__(self):
401399
"""Custom error messages for exception"""
402400
error_message = "({0})\n" "Reason: {1}\n".format(self.status, self.reason)
403-
if self.headers:
404-
error_message += "HTTP response headers: {0}\n".format(self.headers)
405401

406402
if self.body:
407403
error_message += "HTTP response body: {0}\n".format(self.body)

0 commit comments

Comments
 (0)