atk-common 1.45.0__py3-none-any.whl → 1.47.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- atk_common/__init__.py +2 -0
- atk_common/enums/__init__.py +6 -0
- atk_common/enums/command_type_enum.py +9 -9
- atk_common/enums/config_reply_status_type.py +5 -0
- atk_common/enums/encryption_type_enum.py +1 -1
- atk_common/enums/file_exists_enum.py +2 -2
- atk_common/enums/image_part_type_enum.py +2 -2
- atk_common/enums/image_shelf_type.py +5 -0
- atk_common/enums/metering_direction_enum.py +2 -2
- atk_common/enums/process_status_type_enum.py +1 -1
- atk_common/enums/test_image_type_enum.py +7 -0
- atk_common/mq_utils.py +25 -0
- {atk_common-1.45.0.dist-info → atk_common-1.47.0.dist-info}/METADATA +1 -1
- {atk_common-1.45.0.dist-info → atk_common-1.47.0.dist-info}/RECORD +17 -14
- {atk_common-1.45.0.dist-info → atk_common-1.47.0.dist-info}/WHEEL +0 -0
- {atk_common-1.45.0.dist-info → atk_common-1.47.0.dist-info}/licenses/license.txt +0 -0
- {atk_common-1.45.0.dist-info → atk_common-1.47.0.dist-info}/top_level.txt +0 -0
atk_common/__init__.py
CHANGED
@@ -10,6 +10,7 @@ from atk_common.http_utils import is_http_status_ok, is_http_status_internal, ge
|
|
10
10
|
from atk_common.internal_response_utils import create_response, is_response_ok, is_response_http, is_response_internal
|
11
11
|
from atk_common.file_utils import get_image_file_type
|
12
12
|
from atk_common.log_utils import add_log_item, add_log_item_http
|
13
|
+
from atk_common.mq_utils import decode_message
|
13
14
|
from atk_common.rabbitmq_consumer import RabbitMQConsumer
|
14
15
|
|
15
16
|
__all__ = [
|
@@ -43,6 +44,7 @@ __all__ = [
|
|
43
44
|
'get_image_file_type',
|
44
45
|
'add_log_item',
|
45
46
|
'add_log_item_http',
|
47
|
+
'decode_message',
|
46
48
|
'RabbitMQConsumer',
|
47
49
|
'get_current_container_info',
|
48
50
|
]
|
atk_common/enums/__init__.py
CHANGED
@@ -5,6 +5,7 @@ from atk_common.enums.camera_role_enum import CameraRole
|
|
5
5
|
from atk_common.enums.certificate_issuer_enum import CertificateIssuer
|
6
6
|
from atk_common.enums.command_status_type_enum import CommandStatusType
|
7
7
|
from atk_common.enums.command_type_enum import CommandType
|
8
|
+
from atk_common.enums.config_reply_status_type import ConfigReplyStatusType
|
8
9
|
from atk_common.enums.detection_status_type_enum import DetectionStatusType
|
9
10
|
from atk_common.enums.encryption_type_enum import EncryptionType
|
10
11
|
from atk_common.enums.file_exists_enum import FileExists
|
@@ -12,6 +13,7 @@ from atk_common.enums.history_status_type_enum import HistoryStatusType
|
|
12
13
|
from atk_common.enums.image_encoding_type_enum import ImageEncodingType
|
13
14
|
from atk_common.enums.image_part_category_enum import ImagePartCategory
|
14
15
|
from atk_common.enums.image_part_type_enum import ImagePartType
|
16
|
+
from atk_common.enums.image_shelf_type import ImageShelfType
|
15
17
|
from atk_common.enums.metering_direction_enum import MeteringDirection
|
16
18
|
from atk_common.enums.piezo_vehicle_type_enum import PiezoVehicleType
|
17
19
|
from atk_common.enums.process_status_type_enum import ProcessStatusType
|
@@ -20,6 +22,7 @@ from atk_common.enums.section_role_enum import SectionRole
|
|
20
22
|
from atk_common.enums.sensor_order_enum import SensorOrder
|
21
23
|
from atk_common.enums.sensor_type_enum import SensorType
|
22
24
|
from atk_common.enums.speed_control_status_type_enum import SpeedControlStatusType
|
25
|
+
from atk_common.enums.test_image_type_enum import TestImageType
|
23
26
|
from atk_common.enums.violation_type_enum import ViolationType
|
24
27
|
|
25
28
|
__all__ = [
|
@@ -29,6 +32,7 @@ __all__ = [
|
|
29
32
|
'CertificateIssuer',
|
30
33
|
'CommandStatusType',
|
31
34
|
'CommandType',
|
35
|
+
'ConfigReplyStatusType',
|
32
36
|
'DetectionStatusType',
|
33
37
|
'EncryptionType',
|
34
38
|
'FileExists',
|
@@ -36,6 +40,7 @@ __all__ = [
|
|
36
40
|
'ImageEncodingType',
|
37
41
|
'ImagePartCategory',
|
38
42
|
'ImagePartType',
|
43
|
+
'ImageShelfType',
|
39
44
|
'MeteringDirection',
|
40
45
|
'PiezoVehicleType',
|
41
46
|
'ProcessStatusType',
|
@@ -44,5 +49,6 @@ __all__ = [
|
|
44
49
|
'SensorOrder',
|
45
50
|
'SensorType',
|
46
51
|
'SpeedControlStatusType',
|
52
|
+
'TestImageType',
|
47
53
|
'ViolationType',
|
48
54
|
]
|
@@ -1,13 +1,13 @@
|
|
1
1
|
from enum import Enum
|
2
2
|
|
3
3
|
class CommandType(Enum):
|
4
|
-
|
5
|
-
|
6
|
-
|
4
|
+
POINT_ENFORCEMENT = 1
|
5
|
+
SECTION_ENFORCEMENT = 2
|
6
|
+
LOCATION_CONFIG = 3
|
7
7
|
PING = 4
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
8
|
+
CAPTURE_IMAGE = 5
|
9
|
+
GETLAST_IMAGE = 6
|
10
|
+
GETNEXT_IMAGE = 7
|
11
|
+
WRITE_CAMERA_AUX = 8
|
12
|
+
STOP_ENFORCEMENTS = 9
|
13
|
+
RESTART_CAMERA = 10
|
atk_common/mq_utils.py
CHANGED
@@ -0,0 +1,25 @@
|
|
1
|
+
import json
|
2
|
+
from atk_common.error_utils import get_message
|
3
|
+
from atk_common.log_utils import add_log_item
|
4
|
+
|
5
|
+
def decode_message(body, message):
|
6
|
+
import gzip
|
7
|
+
import msgpack
|
8
|
+
try:
|
9
|
+
content_encoding = message.headers.get('content_encoding')
|
10
|
+
if content_encoding is not None and content_encoding == 'gzip':
|
11
|
+
body = gzip.decompress(body)
|
12
|
+
if message.content_type == 'application/json':
|
13
|
+
return body
|
14
|
+
elif message.content_type == 'application/octet-stream':
|
15
|
+
return body
|
16
|
+
elif message.content_type == 'application/x-msgpack' or message.content_type == 'application/msgpack':
|
17
|
+
return msgpack.unpackb(body, raw=False)
|
18
|
+
elif message.content_type.startswith('text/'):
|
19
|
+
return body.decode('utf-8')
|
20
|
+
else:
|
21
|
+
add_log_item('Unknown message content type')
|
22
|
+
return None
|
23
|
+
except Exception as error:
|
24
|
+
add_log_item('Error decoding message: ' + get_message(error))
|
25
|
+
return None
|
@@ -1,4 +1,4 @@
|
|
1
|
-
atk_common/__init__.py,sha256=
|
1
|
+
atk_common/__init__.py,sha256=d_2XoFaQx5CGiBqbTdA3hx-yZ-CAXd-xXYk1DNBAXMg,1978
|
2
2
|
atk_common/datetime_utils.py,sha256=JnhMF3IPEqIcWIcXLFrEugFqqQepeXkwGwT-bVmdqWk,2115
|
3
3
|
atk_common/db_utils.py,sha256=odUtXcS7Mumw5eGyVyVimL_U_lP7TqMX9v8nWO5nMvg,902
|
4
4
|
atk_common/docker_utils.py,sha256=nkUhp2OhwJsm41JDujHDY-JxQfdDjy91duprH59Esfk,2084
|
@@ -10,32 +10,34 @@ atk_common/http_response_utils.py,sha256=7Fw81OVMp6HCvsdtPgvlMywL1srSCVNSvqcBZGT
|
|
10
10
|
atk_common/http_utils.py,sha256=Av6wMa9984zQqXSrU3jndxLQO1xwv9U7YDFvJqZQAuo,664
|
11
11
|
atk_common/internal_response_utils.py,sha256=2X9eLFEy1pO3Aesj1IRXg2yprwNcBDM5_dXaA5vfmMI,694
|
12
12
|
atk_common/log_utils.py,sha256=tw6Ph8oTpxrGYe_BcDTYkgrYmFAb1IxTXTodqctAIiY,504
|
13
|
-
atk_common/mq_utils.py,sha256=
|
13
|
+
atk_common/mq_utils.py,sha256=gMu41yUTZk1Ujxcc2OikrjefShIQPJD_j1d8zM6pGgs,1032
|
14
14
|
atk_common/rabbitmq_consumer.py,sha256=4MhuwZs47Jt1fX4sUxr1MKRe7o2QRbPe9_utXEsa8QE,1907
|
15
15
|
atk_common/response_utils.py,sha256=AxlmwkFoDU5XcFOzBQiuZxAQgswihpKXHSo1T0JJw3Q,556
|
16
|
-
atk_common/enums/__init__.py,sha256=
|
16
|
+
atk_common/enums/__init__.py,sha256=MQGFAlFCaop_GgwxsNls1rEWMjlPHFiQ0OYgZH-rehs,2337
|
17
17
|
atk_common/enums/api_error_type_enum.py,sha256=9oW6ZaZ3lhMwR8r2sVNWGliS9C_jV-otiOYdezAuTp0,91
|
18
18
|
atk_common/enums/camera_cabinet_type_enum.py,sha256=U2NVrsTCBgaMRwYJamnjshAW8Y7xlOVjvUzakdgVH9A,90
|
19
19
|
atk_common/enums/camera_role_enum.py,sha256=E0TH6zXj5EA889D7UndGP7xsgg5W23SneqJCFkA6BII,82
|
20
20
|
atk_common/enums/certificate_issuer_enum.py,sha256=Gsuzn-EQF2LYgkaNZQYb5j5rfMNPdmmF2np5n-ztYrg,98
|
21
21
|
atk_common/enums/command_status_enum.py,sha256=M2Nln27a_DbzI07-gfytWQk2X087JhkU6Fmard5qVHs,127
|
22
22
|
atk_common/enums/command_status_type_enum.py,sha256=M2Nln27a_DbzI07-gfytWQk2X087JhkU6Fmard5qVHs,127
|
23
|
-
atk_common/enums/command_type_enum.py,sha256=
|
23
|
+
atk_common/enums/command_type_enum.py,sha256=9dlYyrKA6FVjTG4UTAVbEDxMCwsoD_SCZP3144VgckE,294
|
24
|
+
atk_common/enums/config_reply_status_type.py,sha256=U-BRYcX_zKLXfWOVEUAEunQexuKvsXQWgi4g9-IGTFg,89
|
24
25
|
atk_common/enums/detection_status_enum.py,sha256=852t9-LaQAzcTELtHtiGPfgwhX58q4uWMvgzq2Spyzs,84
|
25
26
|
atk_common/enums/detection_status_type_enum.py,sha256=oHmoOP2zhcWQBBchj7CwECf99EdT8QSY6T8l5n8Kvcg,88
|
26
|
-
atk_common/enums/encryption_type_enum.py,sha256=
|
27
|
-
atk_common/enums/file_exists_enum.py,sha256=
|
27
|
+
atk_common/enums/encryption_type_enum.py,sha256=vy_1B-lUYZTyBvqAC5bOfhB3bPr5g9K8s5rjfsnm_AE,93
|
28
|
+
atk_common/enums/file_exists_enum.py,sha256=SUmzyczBCRaa9XWjqdFRsg4OczdF0_Z4NX77Ev4vzOo,95
|
28
29
|
atk_common/enums/history_status_type_enum.py,sha256=itxQEQL8zQhkCR-fzKk3PcMDN1YcrbrcDlLcNCQDNHs,152
|
29
30
|
atk_common/enums/http_status_enum.py,sha256=bJSTmkLxHnb04fWSDKuhTWrh_v9iCQM7otAVr731JDk,139
|
30
31
|
atk_common/enums/image_encoding_type_enum.py,sha256=s32PjcrprGUf7MG4UQNE3ssH-y9RiLtbwtNwKQxWMvE,98
|
31
32
|
atk_common/enums/image_part_category.py,sha256=YQ7xtO8v7Ja77Tu-Wo_wewLOULtalPtDsmHvEEWsnsw,87
|
32
33
|
atk_common/enums/image_part_category_enum.py,sha256=YQ7xtO8v7Ja77Tu-Wo_wewLOULtalPtDsmHvEEWsnsw,87
|
33
34
|
atk_common/enums/image_part_type.py,sha256=tg6W9kYMRShOlsxhAJRNRdWH50gC-eF0sqvqsponP-M,111
|
34
|
-
atk_common/enums/image_part_type_enum.py,sha256=
|
35
|
-
atk_common/enums/
|
35
|
+
atk_common/enums/image_part_type_enum.py,sha256=NREEtLNMVVFo-RiOWR_krUSZWRscWMCo2PHHTnZnmLg,113
|
36
|
+
atk_common/enums/image_shelf_type.py,sha256=m2-nWi83tWi-KYpTMphyt-yhK5iGNvHrJBNYjodx1P4,84
|
37
|
+
atk_common/enums/metering_direction_enum.py,sha256=ramBPt0fK_NsToCqiYmtzDVNsLVGbeF39TmSpn_ghTY,107
|
36
38
|
atk_common/enums/piezo_vehicle_type_enum.py,sha256=tlFk9dP7KkJVBna8SIJf6MH9zJD_szSUcDxFATJ6LZE,89
|
37
39
|
atk_common/enums/process_status_enum.py,sha256=09kRE5Cy8Sc7e7wf5gSkIw0RnNzFAWxIrMvn-aElqt8,140
|
38
|
-
atk_common/enums/process_status_type_enum.py,sha256=
|
40
|
+
atk_common/enums/process_status_type_enum.py,sha256=FHtg8Hrf0sAHNGCWiEFTo1hKGBGp6Wb6oyZvFbeL23U,145
|
39
41
|
atk_common/enums/response_status_enum.py,sha256=ogYXlGm0gJJDGlY6Fwq9Kvl861aGPop2qzfXXExzMKw,99
|
40
42
|
atk_common/enums/response_status_type_enum.py,sha256=LjGttBOMwbf5JB-DTXbKCIC7BU8nntP0mW-c8GTeu90,103
|
41
43
|
atk_common/enums/section_role_enum.py,sha256=9rwep4Wmvyvnlrey08TRRoi8VQYAPkylpP00uafIQMg,74
|
@@ -44,8 +46,9 @@ atk_common/enums/sensor_order_enum.py,sha256=TQtLlvjyc8-CnhmA6-iHLhreQziPoBlgFV_
|
|
44
46
|
atk_common/enums/sensor_type_enum.py,sha256=UBa3LPyGTKgEJV578CqFlwXjnlXqVlybrvzdjsHhjSU,80
|
45
47
|
atk_common/enums/speed_control_status_enum.py,sha256=qpURh0K1L1tSpbrzVnckoe4hUn1illIkbo7k4mLfzIM,182
|
46
48
|
atk_common/enums/speed_control_status_type_enum.py,sha256=qpURh0K1L1tSpbrzVnckoe4hUn1illIkbo7k4mLfzIM,182
|
49
|
+
atk_common/enums/test_image_type_enum.py,sha256=HUjxJorehnzRXMNF2uHk2DrAJ3Y_ajQvp0jW-mtlOhU,140
|
47
50
|
atk_common/enums/violation_type_enum.py,sha256=01qTHOj-O8bOc-nwIHVnxLosm4cusD_YuqXM3ZsiRRk,86
|
48
|
-
atk_common-1.
|
51
|
+
atk_common-1.47.0.dist-info/licenses/license.txt,sha256=_0O6fWM00-wTurDjnZhUP_N5QiwGhItaQZqHq5eqadA,1063
|
49
52
|
atk_package/__init__.py,sha256=NcsmwFadivgIeWV0-5ACZxqmfo4EzTkJX0r4N6DFAdg,820
|
50
53
|
atk_package/datetime_utils.py,sha256=qsVF7l90P1-xukG2tV_jLqG9J_Yfl5wTpyfrdPBlyMo,239
|
51
54
|
atk_package/env_utils.py,sha256=bXOrxM3fZUslqfmZt75iphbEJHbG4riJa8XOVzPwIII,313
|
@@ -58,7 +61,7 @@ atk_package/enums/__init__.py,sha256=EtUr_--MQj1Rc_R0sF_ELXIThmhpfmhDWq3YaK9oQMk
|
|
58
61
|
atk_package/enums/command_status_enum.py,sha256=M2Nln27a_DbzI07-gfytWQk2X087JhkU6Fmard5qVHs,127
|
59
62
|
atk_package/enums/speed_control_status_enum.py,sha256=qpURh0K1L1tSpbrzVnckoe4hUn1illIkbo7k4mLfzIM,182
|
60
63
|
shared_python_atk_enforcement/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
61
|
-
atk_common-1.
|
62
|
-
atk_common-1.
|
63
|
-
atk_common-1.
|
64
|
-
atk_common-1.
|
64
|
+
atk_common-1.47.0.dist-info/METADATA,sha256=SMcJw7BL8ZOfAejj1nMZ3S0o_QOzcaOk6Uv6JMJ5a6I,1464
|
65
|
+
atk_common-1.47.0.dist-info/WHEEL,sha256=pxyMxgL8-pra_rKaQ4drOZAegBVuX-G_4nRHjjgWbmo,91
|
66
|
+
atk_common-1.47.0.dist-info/top_level.txt,sha256=4CwRjkLnheIdI4jQwc4tK3dbRc58WqUmoqjkdDTWlME,41
|
67
|
+
atk_common-1.47.0.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|