Skip to content

Commit adf635a

Browse files
update
1 parent 2494e4b commit adf635a

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

Samples/read_multiple_images.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ def on_decoded_barcodes_received(self, result: "DecodedBarcodesResult") -> None:
2121
print("Barcode Text:", item.get_text())
2222

2323
class MyImageSourceStateListener(ImageSourceStateListener):
24-
def __init__(self, cvr:CaptureVisionRouter) -> None:
24+
def __init__(self, cvr_instance:CaptureVisionRouter) -> None:
2525
super().__init__()
26-
self.cvr = cvr
26+
self.cvr_instance = cvr_instance
2727
def on_image_source_state_received(self, state: int) -> None:
2828
if state == EnumImageSourceState.ISS_EXHAUSTED:
29-
if self.cvr != None:
30-
self.cvr.stop_capturing()
29+
if self.cvr_instance != None:
30+
self.cvr_instance.stop_capturing()
3131
if __name__ == '__main__':
3232
# Initialize license.
3333
# You can request and extend a trial license from https://www.dynamsoft.com/customer/license/trialLicense?product=dbr&utm_source=samples&package=python
@@ -36,19 +36,19 @@ def on_image_source_state_received(self, state: int) -> None:
3636
if errorCode != EnumErrorCode.EC_OK and errorCode != EnumErrorCode.EC_LICENSE_CACHE_USED:
3737
print("License initialization failed: ErrorCode:", errorCode, ", ErrorString:", errorMsg)
3838
else:
39-
cvr = CaptureVisionRouter()
39+
cvr_instance = CaptureVisionRouter()
4040

4141
fetcher = DirectoryFetcher()
4242
fetcher.set_directory("../Images")
43-
cvr.set_input(fetcher)
43+
cvr_instance.set_input(fetcher)
4444

4545
receiver = MyCapturedResultReceiver()
46-
cvr.add_result_receiver(receiver)
46+
cvr_instance.add_result_receiver(receiver)
4747

48-
listener = MyImageSourceStateListener(cvr)
49-
cvr.add_image_source_state_listener(listener)
48+
listener = MyImageSourceStateListener(cvr_instance)
49+
cvr_instance.add_image_source_state_listener(listener)
5050

51-
errorCode, errorMsg = cvr.start_capturing("", True)
51+
errorCode, errorMsg = cvr_instance.start_capturing("", True)
5252
if errorCode != EnumErrorCode.EC_OK:
5353
print("Error:", errorMsg)
5454
input("Press Enter to quit...")

0 commit comments

Comments
 (0)