Skip to content

Commit 46326b5

Browse files
Ivan KamkinIvan Kamkin
authored andcommitted
Fixed snippet env configuration
1 parent 5588fcc commit 46326b5

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

snippets/generate/set_size/generate_body.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def make_configuration():
2727

2828
def main():
2929
# Define the output file path
30-
file_name = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "testdata", "Pdf417.png"))
30+
file_name = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "testdata", "pdf417.png"))
3131

3232
# Create API client and generate parameters
3333
configuration = make_configuration()

snippets/read/set_source/recognize_get.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
from aspose_barcode_cloud import ApiClient, Configuration, RecognizeApi, DecodeBarcodeType
2+
import os
23

34

45
def main():
5-
config = Configuration(
6-
client_id="Client Id from https://dashboard.aspose.cloud/applications",
7-
client_secret="Client Secret from https://dashboard.aspose.cloud/applications",
8-
)
6+
access_token = os.getenv("TEST_CONFIGURATION_ACCESS_TOKEN")
7+
if access_token:
8+
config = Configuration(access_token=access_token)
9+
else:
10+
config = Configuration(
11+
client_id="Client Id from https://dashboard.aspose.cloud/applications",
12+
client_secret="Client Secret from https://dashboard.aspose.cloud/applications",
13+
)
914
recognize_api = RecognizeApi(ApiClient(config))
1015

1116
# Call the API to recognize the barcode

snippets/read/set_target_types/recognize_multipart.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def main():
2323
config = make_configuration()
2424
recognize_api = RecognizeApi(ApiClient(config))
2525

26-
file_name = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "testdata", "Pdf417.png"))
26+
file_name = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "testdata", "pdf417.png"))
2727

2828
with open(file_name, "rb") as file_stream:
2929
result = recognize_api.recognize_multipart(DecodeBarcodeType.PDF417, file=file_stream)

0 commit comments

Comments
 (0)