6
6
import shutil
7
7
8
8
from . import utils , logger , camera
9
+ from .components .streamer .streamer import Streamer , load_all_streamers
9
10
10
11
def log_initial ():
11
12
logger .log_quiet ('crowsnest - A webcam Service for multiple Cams and Stream Services.' )
@@ -14,21 +15,6 @@ def log_initial():
14
15
logger .log_quiet (f'Version: { version } ' )
15
16
logger .log_quiet ('Prepare Startup ...' )
16
17
17
- def log_config (config_path ):
18
- logger .log_info ("Print Configfile: '" + config_path + "'" )
19
- with open (config_path , 'r' ) as file :
20
- config_txt = file .read ()
21
- # Remove comments
22
- config_txt = re .sub (r'#.*$' , "" , config_txt , flags = re .MULTILINE )
23
- # Remove multiple whitespaces next to each other at the end of a line
24
- config_txt = re .sub (r'\s*$' , "" , config_txt , flags = re .MULTILINE )
25
- # Add newlines before sections
26
- config_txt = re .sub (r'(\[.*\])$' , "\n \\ 1" , config_txt , flags = re .MULTILINE )
27
- # Remove leading and trailing whitespaces
28
- config_txt = config_txt .strip ()
29
- # Split the config file into lines
30
- logger .log_multiline (config_txt , logger .log_info , logger .indentation )
31
-
32
18
def log_host_info ():
33
19
logger .log_info ("Host Information:" )
34
20
log_pre = logger .indentation
@@ -75,6 +61,30 @@ def log_host_info():
75
61
free = utils .bytes_to_gigabytes (free )
76
62
logger .log_info (f'Diskspace (avail. / total): { free } G / { total } G' , log_pre )
77
63
64
+ def log_streamer ():
65
+ logger .log_info ("Found Streamer:" )
66
+ load_all_streamers ()
67
+ log_pre = logger .indentation
68
+ for bin in Streamer .binaries :
69
+ if Streamer .binaries [bin ] is None :
70
+ continue
71
+ logger .log_info (f'{ bin } : { Streamer .binaries [bin ]} ' , log_pre )
72
+
73
+ def log_config (config_path ):
74
+ logger .log_info ("Print Configfile: '" + config_path + "'" )
75
+ with open (config_path , 'r' ) as file :
76
+ config_txt = file .read ()
77
+ # Remove comments
78
+ config_txt = re .sub (r'#.*$' , "" , config_txt , flags = re .MULTILINE )
79
+ # Remove multiple whitespaces next to each other at the end of a line
80
+ config_txt = re .sub (r'\s*$' , "" , config_txt , flags = re .MULTILINE )
81
+ # Add newlines before sections
82
+ config_txt = re .sub (r'(\[.*\])$' , "\n \\ 1" , config_txt , flags = re .MULTILINE )
83
+ # Remove leading and trailing whitespaces
84
+ config_txt = config_txt .strip ()
85
+ # Split the config file into lines
86
+ logger .log_multiline (config_txt , logger .log_info , logger .indentation )
87
+
78
88
def log_cams ():
79
89
logger .log_info ("Detect available Devices" )
80
90
libcamera = camera .camera_manager .init_camera_type (camera .Libcamera )
0 commit comments