ActionStreamer 0.2.23__tar.gz → 0.2.25__tar.gz

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.
Files changed (29) hide show
  1. {actionstreamer-0.2.23 → actionstreamer-0.2.25}/ActionStreamer/CommonFunctions/CommonFunctions.py +14 -13
  2. {actionstreamer-0.2.23 → actionstreamer-0.2.25}/ActionStreamer/CommonFunctions/Wifi/Wifi.py +5 -5
  3. {actionstreamer-0.2.23 → actionstreamer-0.2.25}/ActionStreamer/Config/Config.py +9 -7
  4. {actionstreamer-0.2.23 → actionstreamer-0.2.25}/ActionStreamer/Device/Device.py +10 -10
  5. {actionstreamer-0.2.23 → actionstreamer-0.2.25}/ActionStreamer/Model/Model.py +8 -7
  6. {actionstreamer-0.2.23 → actionstreamer-0.2.25}/ActionStreamer/WebService/API/API.py +6 -5
  7. {actionstreamer-0.2.23 → actionstreamer-0.2.25}/ActionStreamer/WebService/Event/Event.py +7 -6
  8. {actionstreamer-0.2.23 → actionstreamer-0.2.25}/ActionStreamer/WebService/File/File.py +2 -1
  9. {actionstreamer-0.2.23 → actionstreamer-0.2.25}/ActionStreamer/WebService/Health/Health.py +6 -5
  10. {actionstreamer-0.2.23 → actionstreamer-0.2.25}/ActionStreamer/WebService/LogMessage/LogMessage.py +3 -2
  11. {actionstreamer-0.2.23 → actionstreamer-0.2.25}/ActionStreamer/WebService/Patch/Patch.py +2 -2
  12. {actionstreamer-0.2.23 → actionstreamer-0.2.25}/ActionStreamer/WebService/VideoClip/VideoClip.py +7 -6
  13. {actionstreamer-0.2.23 → actionstreamer-0.2.25}/PKG-INFO +1 -1
  14. {actionstreamer-0.2.23 → actionstreamer-0.2.25}/pyproject.toml +1 -1
  15. {actionstreamer-0.2.23 → actionstreamer-0.2.25}/ActionStreamer/CommonFunctions/Wifi/__init__.py +0 -0
  16. {actionstreamer-0.2.23 → actionstreamer-0.2.25}/ActionStreamer/CommonFunctions/__init__.py +0 -0
  17. {actionstreamer-0.2.23 → actionstreamer-0.2.25}/ActionStreamer/Config/__init__.py +0 -0
  18. {actionstreamer-0.2.23 → actionstreamer-0.2.25}/ActionStreamer/Device/__init__.py +0 -0
  19. {actionstreamer-0.2.23 → actionstreamer-0.2.25}/ActionStreamer/Model/__init__.py +0 -0
  20. {actionstreamer-0.2.23 → actionstreamer-0.2.25}/ActionStreamer/WebService/API/__init__.py +0 -0
  21. {actionstreamer-0.2.23 → actionstreamer-0.2.25}/ActionStreamer/WebService/Event/__init__.py +0 -0
  22. {actionstreamer-0.2.23 → actionstreamer-0.2.25}/ActionStreamer/WebService/File/__init__.py +0 -0
  23. {actionstreamer-0.2.23 → actionstreamer-0.2.25}/ActionStreamer/WebService/Health/__init__.py +0 -0
  24. {actionstreamer-0.2.23 → actionstreamer-0.2.25}/ActionStreamer/WebService/LogMessage/__init__.py +0 -0
  25. {actionstreamer-0.2.23 → actionstreamer-0.2.25}/ActionStreamer/WebService/Patch/__init__.py +0 -0
  26. {actionstreamer-0.2.23 → actionstreamer-0.2.25}/ActionStreamer/WebService/VideoClip/__init__.py +0 -0
  27. {actionstreamer-0.2.23 → actionstreamer-0.2.25}/ActionStreamer/WebService/__init__.py +0 -0
  28. {actionstreamer-0.2.23 → actionstreamer-0.2.25}/ActionStreamer/__init__.py +0 -0
  29. {actionstreamer-0.2.23 → actionstreamer-0.2.25}/README.md +0 -0
@@ -10,11 +10,12 @@ import re
10
10
 
11
11
  import pytz
12
12
  import requests
13
+
13
14
  from ActionStreamer.Config import WebServiceConfig
14
15
 
15
16
  class StandardResult:
16
17
 
17
- def __init__(self, code, description):
18
+ def __init__(self, code: int, description: str):
18
19
  self.Code = code
19
20
  self.Description = description
20
21
 
@@ -30,7 +31,7 @@ class switch(object):
30
31
  yield self.match
31
32
  raise StopIteration
32
33
 
33
- def match(self, *args):
34
+ def match(self, *args) -> bool:
34
35
  """Indicate whether or not to enter a case suite"""
35
36
  if self.fall or not args:
36
37
  return True
@@ -41,7 +42,7 @@ class switch(object):
41
42
  return False
42
43
 
43
44
 
44
- def get_exception_info():
45
+ def get_exception_info() -> tuple[str, int] | tuple[None, None]:
45
46
  exception_type, exception_object, exception_traceback = sys.exc_info()
46
47
  if exception_traceback is not None:
47
48
  filename = exception_traceback.tb_frame.f_code.co_filename
@@ -50,14 +51,14 @@ def get_exception_info():
50
51
  return None, None
51
52
 
52
53
 
53
- def get_line_number():
54
+ def get_line_number() -> int | None:
54
55
  exception_type, exception_object, exception_traceback = sys.exc_info()
55
56
  if exception_traceback is not None:
56
57
  return exception_traceback.tb_lineno
57
58
  return None
58
59
 
59
60
 
60
- def log_to_console(message, agent_name=''):
61
+ def log_to_console(message: str, agent_name='') -> None:
61
62
  # Get the current UTC time
62
63
  utc_now = datetime.now(pytz.utc)
63
64
 
@@ -74,7 +75,7 @@ def log_to_console(message, agent_name=''):
74
75
  print(result_string)
75
76
 
76
77
 
77
- def send_signed_request(ws_config: WebServiceConfig, method, url, path, headers=None, parameters=None, body=None):
78
+ def send_signed_request(ws_config: WebServiceConfig, method: str, url: str, path: str, headers: dict = None, parameters: str = None, body: str = None) -> tuple[int, str]:
78
79
 
79
80
  try:
80
81
  if headers is None:
@@ -119,7 +120,7 @@ def send_signed_request(ws_config: WebServiceConfig, method, url, path, headers=
119
120
  return status_code, response_string
120
121
 
121
122
 
122
- def get_hmac_signature(secret_key, method, path, headers, parameters, body=None):
123
+ def get_hmac_signature(secret_key: str, method: str, path: str, headers, parameters: dict, body: str = None)-> tuple[str, str] | None:
123
124
 
124
125
  try:
125
126
  if 'Content-Type' in headers:
@@ -153,7 +154,7 @@ def get_hmac_signature(secret_key, method, path, headers, parameters, body=None)
153
154
  print(ex)
154
155
 
155
156
 
156
- def dictionary_to_string(dictionary):
157
+ def dictionary_to_string(dictionary: dict) -> str:
157
158
 
158
159
  result = ''
159
160
 
@@ -172,7 +173,7 @@ def dictionary_to_string(dictionary):
172
173
  return result
173
174
 
174
175
 
175
- def upload_file_to_s3(file_path, signed_url):
176
+ def upload_file_to_s3(file_path: str, signed_url: str) -> int:
176
177
 
177
178
  retry = True
178
179
  result = 0
@@ -197,7 +198,7 @@ def upload_file_to_s3(file_path, signed_url):
197
198
  return result
198
199
 
199
200
 
200
- def get_sha256_hash_for_file(file_path):
201
+ def get_sha256_hash_for_file(file_path: str) -> str:
201
202
  # Initialize the hash object (SHA-256 is used in this example)
202
203
  hash_object = hashlib.sha256()
203
204
 
@@ -213,7 +214,7 @@ def get_sha256_hash_for_file(file_path):
213
214
  return file_hash
214
215
 
215
216
 
216
- def create_folders(path):
217
+ def create_folders(path: str) -> None:
217
218
  # Split the path into individual folders
218
219
  folders = path.split(os.sep)
219
220
 
@@ -231,7 +232,7 @@ def create_folders(path):
231
232
  os.makedirs(base_folder)
232
233
 
233
234
 
234
- def get_cpu_frequency():
235
+ def get_cpu_frequency() -> float:
235
236
  with open("/proc/cpuinfo") as f:
236
237
  cpuinfo = f.read()
237
238
  # Find the first occurrence of "cpu MHz"
@@ -242,7 +243,7 @@ def get_cpu_frequency():
242
243
  raise RuntimeError("Unable to find CPU frequency in /proc/cpuinfo")
243
244
 
244
245
 
245
- def get_clock_cycles_per_millisecond():
246
+ def get_clock_cycles_per_millisecond() -> float:
246
247
  frequency_mhz = get_cpu_frequency()
247
248
  frequency_hz = frequency_mhz * 1_000_000
248
249
  cycles_per_millisecond = frequency_hz / 1_000
@@ -2,7 +2,7 @@ import json
2
2
  import subprocess
3
3
 
4
4
 
5
- def add_wifi_connection(ssid, password, connection_name, priority=1):
5
+ def add_wifi_connection(ssid: str, password: str, connection_name: str, priority=1) -> None:
6
6
 
7
7
  try:
8
8
  subprocess.run(['sudo', 'nmcli', 'connection', 'add', 'type', 'wifi', 'ifname', 'wlan0', 'con-name', connection_name, 'ssid', ssid, 'connection.autoconnect-priority', str(priority)], check=True)
@@ -17,7 +17,7 @@ def add_wifi_connection(ssid, password, connection_name, priority=1):
17
17
  print(f"Failed to add connection: {connection_name}. Error: {ex}")
18
18
 
19
19
 
20
- def remove_wifi_connection(ssid):
20
+ def remove_wifi_connection(ssid: str) -> None:
21
21
 
22
22
  try:
23
23
  subprocess.run(['sudo', 'nmcli', 'connection', 'delete', ssid], check=True)
@@ -26,7 +26,7 @@ def remove_wifi_connection(ssid):
26
26
  print(f"Failed to remove connection: {ssid}. It might not exist.")
27
27
 
28
28
 
29
- def set_wifi_priority(ssid, priority):
29
+ def set_wifi_priority(ssid: str, priority: int) -> None:
30
30
 
31
31
  # Example usage:
32
32
  # set_wifi_priority("YourSSID", 100)
@@ -60,7 +60,7 @@ def set_wifi_priority(ssid, priority):
60
60
  print(ex)
61
61
 
62
62
 
63
- def back_up_connections(backup_file_path):
63
+ def back_up_connections(backup_file_path: str) -> None:
64
64
  # Backup all connection data to a JSON file
65
65
  try:
66
66
  result = subprocess.run(['sudo', 'nmcli', '--json', 'connection', 'export'], capture_output=True, text=True, check=True)
@@ -75,7 +75,7 @@ def back_up_connections(backup_file_path):
75
75
  print(f"Failed to backup connections. Error: {ex}")
76
76
 
77
77
 
78
- def restore_connections(backup_file_path):
78
+ def restore_connections(backup_file_path: str) -> None:
79
79
  # Restore all connections from a JSON backup file
80
80
  try:
81
81
  with open(backup_file_path, 'r') as f:
@@ -1,6 +1,8 @@
1
1
  import os
2
2
  import platform
3
3
 
4
+ from ActionStreamer.Config import WebServiceConfig
5
+
4
6
  class WebServiceConfig:
5
7
 
6
8
  """
@@ -31,7 +33,7 @@ class WebServiceConfig:
31
33
 
32
34
  class LogConfig:
33
35
 
34
- def __init__(self, ws_config, device_name, agent_type, agent_version, agent_index, process_id):
36
+ def __init__(self, ws_config: WebServiceConfig, device_name: str, agent_type: str, agent_version: str, agent_index: int, process_id: int):
35
37
  self.ws_config = ws_config
36
38
  self.device_name = device_name
37
39
  self.agent_type = agent_type
@@ -40,11 +42,11 @@ class LogConfig:
40
42
  self.process_id = process_id
41
43
 
42
44
 
43
- def is_windows():
45
+ def is_windows() -> bool:
44
46
  return platform.system() == 'Windows'
45
47
 
46
48
 
47
- def get_config_folder_path(app_name):
49
+ def get_config_folder_path(app_name: str) -> str:
48
50
 
49
51
  if is_windows():
50
52
  username = os.getlogin()
@@ -62,7 +64,7 @@ def get_config_folder_path(app_name):
62
64
  return config_dir
63
65
 
64
66
 
65
- def get_appdata_folder_path(app_name):
67
+ def get_appdata_folder_path(app_name: str) -> str:
66
68
 
67
69
  if is_windows():
68
70
  username = os.getlogin()
@@ -79,7 +81,7 @@ def get_appdata_folder_path(app_name):
79
81
  return appdata_folder_path
80
82
 
81
83
 
82
- def get_config_value(config_folder_path, name):
84
+ def get_config_value(config_folder_path: str, name: str) -> str | None:
83
85
 
84
86
  if not os.path.exists(config_folder_path):
85
87
  os.makedirs(config_folder_path)
@@ -98,7 +100,7 @@ def get_config_value(config_folder_path, name):
98
100
  return None
99
101
 
100
102
 
101
- def set_config_value(config_folder_path, name, value):
103
+ def set_config_value(config_folder_path: str, name: str, value: str) -> None:
102
104
 
103
105
  if not os.path.exists(config_folder_path):
104
106
  os.makedirs(config_folder_path)
@@ -114,4 +116,4 @@ def set_config_value(config_folder_path, name, value):
114
116
  file.write(value)
115
117
  print(f"Successfully set the value in '{name}'")
116
118
  except Exception as ex:
117
- print(f"Error occurred while setting value in '{name}': {ex}")
119
+ print(f"Error occurred while setting value in '{name}': {ex}")
@@ -4,7 +4,7 @@ import sys
4
4
  import platform
5
5
  import subprocess
6
6
 
7
- def process_cpuinfo():
7
+ def process_cpuinfo() -> str:
8
8
 
9
9
  device_name = "0000000000000000"
10
10
 
@@ -23,7 +23,7 @@ def process_cpuinfo():
23
23
  return device_name
24
24
 
25
25
 
26
- def get_serial_number():
26
+ def get_serial_number() -> str:
27
27
 
28
28
  serial_number = ""
29
29
  manufacturer = ""
@@ -41,7 +41,7 @@ def get_serial_number():
41
41
  return manufacturer + "_" + serial_number
42
42
 
43
43
 
44
- def get_ip_address():
44
+ def get_ip_address() -> str:
45
45
 
46
46
  try:
47
47
  # Get the local hostname
@@ -55,7 +55,7 @@ def get_ip_address():
55
55
  return ip_address
56
56
 
57
57
 
58
- def get_cpu_serial_number_windows():
58
+ def get_cpu_serial_number_windows() -> str:
59
59
 
60
60
  try:
61
61
  import wmi
@@ -67,7 +67,7 @@ def get_cpu_serial_number_windows():
67
67
  return str(ex)
68
68
 
69
69
 
70
- def get_cpu_serial_number_linux():
70
+ def get_cpu_serial_number_linux() -> str:
71
71
 
72
72
  try:
73
73
  with open('/proc/cpuinfo', 'r') as f:
@@ -79,7 +79,7 @@ def get_cpu_serial_number_linux():
79
79
  return str(ex)
80
80
 
81
81
 
82
- def get_manufacturer():
82
+ def get_manufacturer() -> tuple[str, int]:
83
83
 
84
84
  if platform.system() == "Windows":
85
85
  return get_manufacturer_windows()
@@ -87,7 +87,7 @@ def get_manufacturer():
87
87
  return get_manufacturer_linux()
88
88
 
89
89
 
90
- def get_manufacturer_windows():
90
+ def get_manufacturer_windows() -> tuple[str, int]:
91
91
  try:
92
92
  import wmi
93
93
  w = wmi.WMI()
@@ -100,7 +100,7 @@ def get_manufacturer_windows():
100
100
  return "", 1
101
101
 
102
102
 
103
- def get_manufacturer_linux():
103
+ def get_manufacturer_linux() -> tuple[str, int]:
104
104
  try:
105
105
  with open("/proc/cpuinfo", "r") as f:
106
106
  for line in f:
@@ -120,7 +120,7 @@ def get_manufacturer_linux():
120
120
  return "", 1
121
121
 
122
122
 
123
- def parse_raspberry_pi_model(model):
123
+ def parse_raspberry_pi_model(model: str) -> str:
124
124
 
125
125
  if "Raspberry Pi" in model:
126
126
  parts = model.split()
@@ -129,7 +129,7 @@ def parse_raspberry_pi_model(model):
129
129
  return model
130
130
 
131
131
 
132
- def parse_manufacturer(manufacturer):
132
+ def parse_manufacturer(manufacturer: str) -> str:
133
133
 
134
134
  if "Intel" in manufacturer:
135
135
  return "Intel"
@@ -34,7 +34,7 @@ class EventType:
34
34
 
35
35
  class Event:
36
36
 
37
- def __init__(self, key, userID, deviceID, agentTypeID, agentID, eventTypeID, eventStatus, eventParameters, result, percentComplete, priority, expirationEpoch, attemptNumber, maxAttempts, checkoutToken, tagString, tagNumber, creationDate, createdBy, lastModifiedDate, lastModifiedBy):
37
+ def __init__(self, key: int, userID: int, deviceID: int, agentTypeID: int, agentID: int, eventTypeID: int, eventStatus: str, eventParameters: str, processID: int, result: str, percentComplete: int, priority: int, expirationEpoch: int, attemptNumber: int, maxAttempts: int, checkoutToken: str, tagString: str, tagNumber: int, creationDate: str, createdBy: int, lastModifiedDate: str, lastModifiedBy: int):
38
38
 
39
39
  self.eventID = key
40
40
  self.userID = userID
@@ -44,6 +44,7 @@ class Event:
44
44
  self.eventTypeID = eventTypeID
45
45
  self.eventStatus = eventStatus
46
46
  self.eventParameters = eventParameters
47
+ self.processID = processID
47
48
  self.result = result
48
49
  self.percentComplete = percentComplete
49
50
  self.priority = priority
@@ -61,8 +62,8 @@ class Event:
61
62
 
62
63
  class EventWithNames(Event):
63
64
 
64
- def __init__(self, key, userID, deviceID, agentTypeID, agentID, eventTypeID, eventStatus, eventParameters, result, percentComplete, priority, expirationEpoch, attemptNumber, maxAttempts, checkoutToken, tagString, tagNumber, creationDate, createdBy, lastModifiedDate, lastModifiedBy, deviceName, eventType, agentType, version, eventStatusName, agentIndex):
65
- super().__init__(key, userID, deviceID, agentTypeID, agentID, eventTypeID, eventStatus, eventParameters, result, percentComplete, priority, expirationEpoch, attemptNumber, maxAttempts, checkoutToken, tagString, tagNumber, creationDate, createdBy, lastModifiedDate, lastModifiedBy)
65
+ def __init__(self, key: int, userID: int, deviceID: int, agentTypeID: int, agentID: int, eventTypeID: int, eventStatus: str, eventParameters: str, processID: int, result: str, percentComplete: int, priority: int, expirationEpoch: int, attemptNumber: int, maxAttempts: int, checkoutToken: str, tagString: str, tagNumber: int, creationDate: str, createdBy: int, lastModifiedDate: str, lastModifiedBy: int, deviceName: str, eventType: str, agentType: str, version: str, eventStatusName: str, agentIndex: int):
66
+ super().__init__(key, userID, deviceID, agentTypeID, agentID, eventTypeID, eventStatus, eventParameters, processID, result, percentComplete, priority, expirationEpoch, attemptNumber, maxAttempts, checkoutToken, tagString, tagNumber, creationDate, createdBy, lastModifiedDate, lastModifiedBy)
66
67
  self.deviceName = deviceName
67
68
  self.eventType = eventType
68
69
  self.agentType = agentType
@@ -73,7 +74,7 @@ class EventWithNames(Event):
73
74
 
74
75
  class RecordingParameters:
75
76
 
76
- def __init__(self, height, width, fps, bitrate, vflip, hflip, encoding, segment_length_seconds):
77
+ def __init__(self, height: int, width: int, fps: float, bitrate: int, vflip: int, hflip: int, encoding: str, segment_length_seconds: float):
77
78
  self.height = height
78
79
  self.width = width
79
80
  self.fps = fps
@@ -86,7 +87,7 @@ class RecordingParameters:
86
87
 
87
88
  class VideoClip:
88
89
 
89
- def __init__(self, file_id=0, ts_file_id=0, video_clip_parameters='', local_file_path='', height=0, width=0, frames_per_second=0, bitrate = 0, audio_status=0, start_time=0, start_time_ms=0, end_time=0, end_time_ms=0, clip_length_in_seconds=0):
90
+ def __init__(self, file_id=0, ts_file_id=0, video_clip_parameters='', local_file_path='', height=0, width=0, frames_per_second:float=0, bitrate = 0, audio_status=0, start_time=0, start_time_ms=0, end_time=0, end_time_ms=0, clip_length_in_seconds:float=0):
90
91
  self.fileID = file_id
91
92
  self.tSFileID = ts_file_id
92
93
  self.videoClipParameters = video_clip_parameters
@@ -105,7 +106,7 @@ class VideoClip:
105
106
 
106
107
  class TranscodingParameters:
107
108
 
108
- def __init__(self, file_id, source, source_file, target_file, fps, codec):
109
+ def __init__(self, file_id: int, source: str, source_file: str, target_file: str, fps: float, codec: str):
109
110
  self.fileID = file_id
110
111
  self.source = source
111
112
  self.sourceFile = source_file
@@ -116,7 +117,7 @@ class TranscodingParameters:
116
117
 
117
118
  class TransferArgs:
118
119
 
119
- def __init__(self, video_clip_id, local_file_path, remote_filename, remote_folder_path):
120
+ def __init__(self, video_clip_id: int, local_file_path: str, remote_filename: str, remote_folder_path: str):
120
121
  self.videoClipId = video_clip_id
121
122
  self.localFilePath = local_file_path
122
123
  self.remoteFilename = remote_filename
@@ -3,16 +3,17 @@ import json
3
3
  from json import JSONEncoder
4
4
 
5
5
  import ActionStreamer.CommonFunctions
6
+ from ActionStreamer.Config import WebServiceConfig
6
7
 
7
8
  class PatchOperation:
8
9
 
9
- def __init__(self, field_name, value):
10
+ def __init__(self, field_name: str, value):
10
11
  self.field_name = field_name
11
12
  self.value = value
12
13
 
13
14
  class WebServiceResult:
14
15
 
15
- def __init__(self, code, description, http_response_code, http_response_string, json_data):
16
+ def __init__(self, code: int, description: str, http_response_code: int, http_response_string: str, json_data: str):
16
17
  self.code = code
17
18
  self.description = description
18
19
  self.http_response_code = http_response_code
@@ -22,12 +23,12 @@ class WebServiceResult:
22
23
  class DateTimeEncoder(JSONEncoder):
23
24
 
24
25
  # Override the default method
25
- def default(self, obj):
26
+ def default(self, obj) -> str | None:
26
27
  if isinstance(obj, (datetime.date, datetime.datetime)):
27
28
  return obj.isoformat()
28
29
 
29
30
 
30
- def register_agent(ws_config, device_name, agent_type, agent_version, agent_index, process_id):
31
+ def register_agent(ws_config: WebServiceConfig, device_name: str, agent_type: str, agent_version: str, agent_index: int, process_id: int) -> tuple[int, str]:
31
32
 
32
33
  try:
33
34
  jsonPostData = {"deviceName":device_name, "agentType":agent_type, "agentVersion":agent_version, "agentIndex":agent_index, "processID":process_id}
@@ -51,4 +52,4 @@ def register_agent(ws_config, device_name, agent_type, agent_version, agent_inde
51
52
  response_code = -1
52
53
  response_string = "Exception in RegisterAgent"
53
54
 
54
- return response_code, response_string
55
+ return response_code, response_string
@@ -2,8 +2,9 @@ import json
2
2
 
3
3
  import ActionStreamer.CommonFunctions
4
4
  import ActionStreamer.WebService.API
5
+ import ActionStreamer.Config
5
6
 
6
- def get_pending_event_list(ws_config, device_name):
7
+ def get_pending_event_list(ws_config: ActionStreamer.Config.WebServiceConfig, device_name: str) -> ActionStreamer.WebService.API.WebServiceResult:
7
8
 
8
9
  ws_result = ActionStreamer.WebService.API.WebServiceResult(0, '', '', '', None)
9
10
 
@@ -37,7 +38,7 @@ def get_pending_event_list(ws_config, device_name):
37
38
  return ws_result
38
39
 
39
40
 
40
- def dequeue_event(ws_config, device_name, agent_type):
41
+ def dequeue_event(ws_config: ActionStreamer.Config.WebServiceConfig, device_name: str, agent_type: str) -> ActionStreamer.WebService.API.WebServiceResult:
41
42
 
42
43
  ws_result = ActionStreamer.WebService.API.WebServiceResult(0, '', '', '', None)
43
44
 
@@ -72,7 +73,7 @@ def dequeue_event(ws_config, device_name, agent_type):
72
73
  return ws_result
73
74
 
74
75
 
75
- def create_event(ws_config, device_name, agent_type, event_type, event_parameters, priority=1, max_attempts=0, expiration_date=None):
76
+ def create_event(ws_config: ActionStreamer.Config.WebServiceConfig, device_name: str, agent_type: str, event_type: str, event_parameters: str, priority=1, max_attempts=0, expiration_epoch=0) -> ActionStreamer.WebService.API.WebServiceResult:
76
77
 
77
78
  ws_result = ActionStreamer.WebService.API.WebServiceResult(0, '', '', '', None)
78
79
 
@@ -90,7 +91,7 @@ def create_event(ws_config, device_name, agent_type, event_type, event_parameter
90
91
  "eventParameters": event_parameters,
91
92
  "priority": priority,
92
93
  "maxAttempts": max_attempts,
93
- "expirationDate": expiration_date
94
+ "expirationDate": expiration_epoch
94
95
  }
95
96
 
96
97
  body = json.dumps(json_post_data)
@@ -112,7 +113,7 @@ def create_event(ws_config, device_name, agent_type, event_type, event_parameter
112
113
  return ws_result
113
114
 
114
115
 
115
- def get_event_details(ws_config, event_id):
116
+ def get_event_details(ws_config: ActionStreamer.Config.WebServiceConfig, event_id: int) -> ActionStreamer.WebService.API.WebServiceResult:
116
117
 
117
118
  ws_result = ActionStreamer.WebService.API.WebServiceResult(0, '', '', '', None)
118
119
 
@@ -141,7 +142,7 @@ def get_event_details(ws_config, event_id):
141
142
  return ws_result
142
143
 
143
144
 
144
- def update_event(ws_config, event_id, event_status, result, process_id, tag_string='', tag_number=0, attempt_number=1):
145
+ def update_event(ws_config: ActionStreamer.Config.WebServiceConfig, event_id: int, event_status: int, result: str, process_id: int, tag_string='', tag_number=0, attempt_number=1) -> ActionStreamer.WebService.API.WebServiceResult:
145
146
 
146
147
  ws_result = ActionStreamer.WebService.API.WebServiceResult(0, '', '', '', None)
147
148
 
@@ -2,6 +2,7 @@ import json
2
2
 
3
3
  import ActionStreamer.CommonFunctions
4
4
  import ActionStreamer.WebService.API
5
+ from ActionStreamer.Config import WebServiceConfig
5
6
 
6
7
  def create_file(ws_config: ActionStreamer.Config.WebServiceConfig, device_name: str, filename: str, file_size: int, sha256_hash: str) -> tuple[int, str, str, int]:
7
8
 
@@ -61,7 +62,7 @@ def create_file(ws_config: ActionStreamer.Config.WebServiceConfig, device_name:
61
62
  return response_code, response_string, signed_url, file_id
62
63
 
63
64
 
64
- def update_file_upload_success(ws_config, device_name, file_id):
65
+ def update_file_upload_success(ws_config: WebServiceConfig, device_name: str, file_id: int) -> tuple[int, str]:
65
66
 
66
67
  try:
67
68
  json_post_data = {'deviceSerial':device_name}
@@ -2,12 +2,13 @@ import json
2
2
 
3
3
  import ActionStreamer.CommonFunctions
4
4
  from ActionStreamer import CommonFunctions
5
- from ActionStreamer.WebService.API import WebServiceResult
5
+ import ActionStreamer.WebService.API
6
+ import ActionStreamer.Config
6
7
 
7
8
 
8
- def create_health(ws_config, device_name, health_json):
9
+ def create_health(ws_config: ActionStreamer.Config.WebServiceConfig, device_name: str, health_json: str) -> ActionStreamer.WebService.API.WebServiceResult:
9
10
 
10
- ws_result = WebServiceResult(0, '', '', '', None)
11
+ ws_result = ActionStreamer.WebService.API.WebServiceResult(0, '', '', '', None)
11
12
 
12
13
  try:
13
14
  method = "POST"
@@ -39,9 +40,9 @@ def create_health(ws_config, device_name, health_json):
39
40
  return ws_result
40
41
 
41
42
 
42
- def update_health(ws_config, device_name, health_json):
43
+ def update_health(ws_config: ActionStreamer.Config.WebServiceConfig, device_name: str, health_json: str) -> ActionStreamer.WebService.API.WebServiceResult:
43
44
 
44
- ws_result = WebServiceResult(0, '', '', '', None)
45
+ ws_result = ActionStreamer.WebService.API.WebServiceResult(0, '', '', '', None)
45
46
 
46
47
  try:
47
48
  method = "PUT"
@@ -2,9 +2,10 @@ import datetime
2
2
  import json
3
3
 
4
4
  import ActionStreamer.CommonFunctions
5
- from ActionStreamer.Config import LogConfig
5
+ import ActionStreamer.Config
6
6
 
7
- def create_log_message(log_config: LogConfig, message, log_to_console=True):
7
+
8
+ def create_log_message(log_config: ActionStreamer.Config.LogConfig, message: str, log_to_console=True) -> tuple[int, str]:
8
9
 
9
10
  try:
10
11
  if (log_to_console):
@@ -3,11 +3,11 @@ import json
3
3
  from ActionStreamer.WebService.API import PatchOperation
4
4
 
5
5
 
6
- def add_patch_operation(operations, field_name, value):
6
+ def add_patch_operation(operations: list, field_name: str, value: str | int) -> list:
7
7
  operations.append(PatchOperation(field_name, value))
8
8
 
9
9
 
10
- def generate_patch_json(operations):
10
+ def generate_patch_json(operations: list) -> str:
11
11
  # Convert all values to strings
12
12
  operations_str = [{k: str(v) for k, v in vars(op).items()} for op in operations]
13
13
  json_data = json.dumps(operations_str)
@@ -1,10 +1,11 @@
1
1
  import json
2
2
 
3
3
  from ActionStreamer import CommonFunctions
4
- from ActionStreamer.WebService.API import WebServiceResult
4
+ from ActionStreamer.Config import WebServiceConfig
5
5
  from ActionStreamer.WebService.Patch import *
6
+ from ActionStreamer.Model import VideoClip
6
7
 
7
- def create_video_clip(ws_config, device_name, video_clip):
8
+ def create_video_clip(ws_config: WebServiceConfig, device_name: str, video_clip: VideoClip) -> tuple[int, str]:
8
9
 
9
10
  try:
10
11
  method = "POST"
@@ -29,7 +30,7 @@ def create_video_clip(ws_config, device_name, video_clip):
29
30
  return response_code, response_string
30
31
 
31
32
 
32
- def update_file_id(ws_config, video_clip_id, file_id):
33
+ def update_file_id(ws_config: WebServiceConfig, video_clip_id: int, file_id: int) -> tuple[int, str]:
33
34
 
34
35
  try:
35
36
  operations_list = []
@@ -42,7 +43,7 @@ def update_file_id(ws_config, video_clip_id, file_id):
42
43
  parameters = ''
43
44
  body = generate_patch_json(operations_list)
44
45
 
45
- response_code, response_code = CommonFunctions.send_signed_request(ws_config, method, url, path, headers, parameters, body)
46
+ response_code, response_string = CommonFunctions.send_signed_request(ws_config, method, url, path, headers, parameters, body)
46
47
 
47
48
  except Exception as ex:
48
49
 
@@ -52,6 +53,6 @@ def update_file_id(ws_config, video_clip_id, file_id):
52
53
  print(ex)
53
54
 
54
55
  response_code = -1
55
- response_code = "Exception in UpdateVideoClipFileID"
56
+ response_string = "Exception in UpdateVideoClipFileID"
56
57
 
57
- return response_code, response_code
58
+ return response_code, response_string
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ActionStreamer
3
- Version: 0.2.23
3
+ Version: 0.2.25
4
4
  Summary: A library for the ActionStreamer API.
5
5
  Author: ActionStreamer
6
6
  Author-email: joe@actionstreamer.com
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "ActionStreamer"
3
- version = "0.2.23"
3
+ version = "0.2.25"
4
4
  description = "A library for the ActionStreamer API."
5
5
  authors = ["ActionStreamer <joe@actionstreamer.com>"]
6
6
  readme = "README.md"