feature/hls: Add HLS playback support, and refactors documentation for better usability and maintainability. #1
10
settings.py
10
settings.py
@@ -499,12 +499,16 @@ else:
|
||||
else:
|
||||
# parse settings in a safe way, without exec
|
||||
current_settings_dict = {}
|
||||
# Python 3.8+ uses ast.Constant; older versions use ast.Num, ast.Str, ast.NameConstant
|
||||
attributes = {
|
||||
ast.Constant: 'value',
|
||||
ast.NameConstant: 'value',
|
||||
ast.Num: 'n',
|
||||
ast.Str: 's',
|
||||
}
|
||||
try:
|
||||
attributes[ast.Num] = 'n'
|
||||
attributes[ast.Str] = 's'
|
||||
attributes[ast.NameConstant] = 'value'
|
||||
except AttributeError:
|
||||
pass # Removed in Python 3.12+
|
||||
module_node = ast.parse(settings_text)
|
||||
for node in module_node.body:
|
||||
if type(node) != ast.Assign:
|
||||
|
||||
Reference in New Issue
Block a user