ActionStreamer 0.8.2__tar.gz → 0.8.4__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.
- {actionstreamer-0.8.2 → actionstreamer-0.8.4}/PKG-INFO +1 -1
- {actionstreamer-0.8.2 → actionstreamer-0.8.4}/actionstreamer/CommonFunctions/CommonFunctions.py +31 -0
- {actionstreamer-0.8.2 → actionstreamer-0.8.4}/actionstreamer/CommonFunctions/Wifi/Wifi.py +1 -1
- {actionstreamer-0.8.2 → actionstreamer-0.8.4}/actionstreamer/CommonFunctions/__init__.py +2 -2
- {actionstreamer-0.8.2 → actionstreamer-0.8.4}/actionstreamer/Config/Config.py +1 -1
- {actionstreamer-0.8.2 → actionstreamer-0.8.4}/pyproject.toml +1 -1
- {actionstreamer-0.8.2 → actionstreamer-0.8.4}/README.md +0 -0
- {actionstreamer-0.8.2 → actionstreamer-0.8.4}/actionstreamer/CommonFunctions/Wifi/__init__.py +0 -0
- {actionstreamer-0.8.2 → actionstreamer-0.8.4}/actionstreamer/Config/__init__.py +0 -0
- {actionstreamer-0.8.2 → actionstreamer-0.8.4}/actionstreamer/Device/Device.py +0 -0
- {actionstreamer-0.8.2 → actionstreamer-0.8.4}/actionstreamer/Device/__init__.py +0 -0
- {actionstreamer-0.8.2 → actionstreamer-0.8.4}/actionstreamer/Model/Model.py +0 -0
- {actionstreamer-0.8.2 → actionstreamer-0.8.4}/actionstreamer/Model/__init__.py +0 -0
- {actionstreamer-0.8.2 → actionstreamer-0.8.4}/actionstreamer/WebService/API/API.py +0 -0
- {actionstreamer-0.8.2 → actionstreamer-0.8.4}/actionstreamer/WebService/API/__init__.py +0 -0
- {actionstreamer-0.8.2 → actionstreamer-0.8.4}/actionstreamer/WebService/Event/Event.py +0 -0
- {actionstreamer-0.8.2 → actionstreamer-0.8.4}/actionstreamer/WebService/Event/__init__.py +0 -0
- {actionstreamer-0.8.2 → actionstreamer-0.8.4}/actionstreamer/WebService/File/File.py +0 -0
- {actionstreamer-0.8.2 → actionstreamer-0.8.4}/actionstreamer/WebService/File/__init__.py +0 -0
- {actionstreamer-0.8.2 → actionstreamer-0.8.4}/actionstreamer/WebService/Health/Health.py +0 -0
- {actionstreamer-0.8.2 → actionstreamer-0.8.4}/actionstreamer/WebService/Health/__init__.py +0 -0
- {actionstreamer-0.8.2 → actionstreamer-0.8.4}/actionstreamer/WebService/LogMessage/LogMessage.py +0 -0
- {actionstreamer-0.8.2 → actionstreamer-0.8.4}/actionstreamer/WebService/LogMessage/__init__.py +0 -0
- {actionstreamer-0.8.2 → actionstreamer-0.8.4}/actionstreamer/WebService/Patch/Patch.py +0 -0
- {actionstreamer-0.8.2 → actionstreamer-0.8.4}/actionstreamer/WebService/Patch/__init__.py +0 -0
- {actionstreamer-0.8.2 → actionstreamer-0.8.4}/actionstreamer/WebService/VideoClip/VideoClip.py +0 -0
- {actionstreamer-0.8.2 → actionstreamer-0.8.4}/actionstreamer/WebService/VideoClip/__init__.py +0 -0
- {actionstreamer-0.8.2 → actionstreamer-0.8.4}/actionstreamer/WebService/__init__.py +0 -0
- {actionstreamer-0.8.2 → actionstreamer-0.8.4}/actionstreamer/__init__.py +0 -0
{actionstreamer-0.8.2 → actionstreamer-0.8.4}/actionstreamer/CommonFunctions/CommonFunctions.py
RENAMED
|
@@ -349,3 +349,34 @@ def get_video_length_in_seconds(file_path):
|
|
|
349
349
|
|
|
350
350
|
return total_seconds
|
|
351
351
|
|
|
352
|
+
|
|
353
|
+
def change_hostname(new_hostname):
|
|
354
|
+
|
|
355
|
+
try:
|
|
356
|
+
# Validate the new hostname
|
|
357
|
+
if not new_hostname.isalnum() or len(new_hostname) > 63:
|
|
358
|
+
raise ValueError("Hostname must be alphanumeric and no more than 63 characters long.")
|
|
359
|
+
|
|
360
|
+
# Update /etc/hostname
|
|
361
|
+
with open('/etc/hostname', 'w') as hostname_file:
|
|
362
|
+
hostname_file.write(new_hostname + '\n')
|
|
363
|
+
|
|
364
|
+
# Update /etc/hosts
|
|
365
|
+
with open('/etc/hosts', 'r') as hosts_file:
|
|
366
|
+
hosts_content = hosts_file.readlines()
|
|
367
|
+
|
|
368
|
+
with open('/etc/hosts', 'w') as hosts_file:
|
|
369
|
+
for line in hosts_content:
|
|
370
|
+
if '127.0.1.1' in line:
|
|
371
|
+
hosts_file.write(f'127.0.1.1\t{new_hostname}\n')
|
|
372
|
+
else:
|
|
373
|
+
hosts_file.write(line)
|
|
374
|
+
|
|
375
|
+
# Apply the hostname change immediately
|
|
376
|
+
os.system(f'hostname {new_hostname}')
|
|
377
|
+
|
|
378
|
+
print(f"Hostname changed to {new_hostname}. Please reboot the system for all changes to take effect.")
|
|
379
|
+
|
|
380
|
+
except Exception as ex:
|
|
381
|
+
print("Exception occurred while changing hostname:", str(ex))
|
|
382
|
+
|
|
@@ -34,7 +34,7 @@ def set_wifi_priority(ssid: str, priority: int) -> None:
|
|
|
34
34
|
try:
|
|
35
35
|
# Get the UUID of the connection
|
|
36
36
|
result = subprocess.run(
|
|
37
|
-
['nmcli', '-g', 'uuid', 'connection', 'show', ssid],
|
|
37
|
+
['nmcli', '-g', 'connection.uuid', 'connection', 'show', ssid],
|
|
38
38
|
capture_output=True, text=True, check=True
|
|
39
39
|
)
|
|
40
40
|
uuid = result.stdout.strip()
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
from .CommonFunctions import StandardResult, switch, get_exception_info, get_line_number, log_to_console, send_signed_request, get_hmac_signature, dictionary_to_string, upload_file_to_s3, get_sha256_hash_for_file, create_folders, download_file, concatenate_videos, concatenate_videos_by_list, get_video_length_in_seconds
|
|
1
|
+
from .CommonFunctions import StandardResult, switch, get_exception_info, get_line_number, log_to_console, send_signed_request, get_hmac_signature, dictionary_to_string, upload_file_to_s3, get_sha256_hash_for_file, create_folders, download_file, concatenate_videos, concatenate_videos_by_list, get_video_length_in_seconds, change_hostname
|
|
2
2
|
from . import Wifi
|
|
3
3
|
|
|
4
|
-
__all__ = ['StandardResult', 'switch', 'get_exception_info', 'get_line_number', 'log_to_console', 'send_signed_request', 'get_hmac_signature', 'dictionary_to_string', 'upload_file_to_s3', 'get_sha256_hash_for_file', 'Wifi', 'create_folders', 'download_file', 'concatenate_videos', 'concatenate_videos_by_list', 'get_video_length_in_seconds']
|
|
4
|
+
__all__ = ['StandardResult', 'switch', 'get_exception_info', 'get_line_number', 'log_to_console', 'send_signed_request', 'get_hmac_signature', 'dictionary_to_string', 'upload_file_to_s3', 'get_sha256_hash_for_file', 'Wifi', 'create_folders', 'download_file', 'concatenate_videos', 'concatenate_videos_by_list', 'get_video_length_in_seconds', 'change_hostname']
|
|
@@ -98,7 +98,7 @@ def get_config_value(config_folder_path: str, name: str, default_value: str = ''
|
|
|
98
98
|
|
|
99
99
|
try:
|
|
100
100
|
with open(file_path, 'r') as file:
|
|
101
|
-
contents = file.read()
|
|
101
|
+
contents = file.read().strip()
|
|
102
102
|
return contents
|
|
103
103
|
except FileNotFoundError:
|
|
104
104
|
print(f"File '{name}' not found in the specified folder '{config_folder_path}'")
|
|
File without changes
|
{actionstreamer-0.8.2 → actionstreamer-0.8.4}/actionstreamer/CommonFunctions/Wifi/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{actionstreamer-0.8.2 → actionstreamer-0.8.4}/actionstreamer/WebService/LogMessage/LogMessage.py
RENAMED
|
File without changes
|
{actionstreamer-0.8.2 → actionstreamer-0.8.4}/actionstreamer/WebService/LogMessage/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{actionstreamer-0.8.2 → actionstreamer-0.8.4}/actionstreamer/WebService/VideoClip/VideoClip.py
RENAMED
|
File without changes
|
{actionstreamer-0.8.2 → actionstreamer-0.8.4}/actionstreamer/WebService/VideoClip/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|