|
6 | 6 | CheckResult, GraphicFieldType |
7 | 7 |
|
8 | 8 | host = os.getenv("API_BASE_PATH", "http://localhost:8080") |
9 | | -license = os.getenv("TEST_LICENSE", None) # optional, used here only for smoke test purposes |
| 9 | +regula_license = os.getenv("TEST_LICENSE", None) # optional, used here only for smoke test purposes |
10 | 10 |
|
11 | 11 | # read optional local license file |
12 | 12 | if os.path.isfile('regula.license') and os.access('regula.license', os.R_OK): |
13 | 13 | with open("regula.license", "rb") as f: |
14 | 14 | print("Found local license file. Using it for performing request...") |
15 | | - license = f.read() |
| 15 | + regula_license = f.read() |
16 | 16 |
|
17 | 17 | with open("australia_passport.jpg", "rb") as f: |
18 | 18 | input_image = f.read() |
19 | 19 |
|
20 | 20 | with DocumentReaderApi(host) as api: |
21 | | - api.license = license |
| 21 | + api.license = regula_license |
22 | 22 |
|
23 | 23 | params = ProcessParams( |
24 | 24 | scenario=Scenario.FULL_PROCESS, |
|
43 | 43 | document_image = response.images.document_image() |
44 | 44 | portrait_field = response.images.get_field(GraphicFieldType.PORTRAIT) |
45 | 45 | portrait_from_visual = portrait_field.get_value(Source.VISUAL) |
46 | | - with open('portrait.jpg', 'wb') as f: f.write(portrait_from_visual) |
47 | | - with open('document-image.jpg', 'wb') as f: f.write(document_image) |
48 | | - |
49 | | - # low-lvl(original) response |
50 | | - response.low_lvl_response |
| 46 | + with open('portrait.jpg', 'wb') as f: |
| 47 | + f.write(portrait_from_visual) |
| 48 | + with open('document-image.jpg', 'wb') as f: |
| 49 | + f.write(document_image) |
51 | 50 |
|
52 | 51 | print(""" |
53 | 52 | --------------------------------------------------------------------------- |
|
0 commit comments