mirror of
https://github.com/blakeblackshear/frigate.git
synced 2024-11-21 19:07:46 +01:00
Make wsdl_dir path resolving more robust (#10967)
Relying on importlib to resolve the path to the wsdl directory is more robust, since it traverses all site-packages directories, that are part of the PYTHONPATH.
This commit is contained in:
parent
3788df5bc6
commit
b65656fa87
@ -1,8 +1,9 @@
|
|||||||
"""Configure and control camera via onvif."""
|
"""Configure and control camera via onvif."""
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
import site
|
|
||||||
from enum import Enum
|
from enum import Enum
|
||||||
|
from importlib.util import find_spec
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
import numpy
|
import numpy
|
||||||
from onvif import ONVIFCamera, ONVIFError
|
from onvif import ONVIFCamera, ONVIFError
|
||||||
@ -50,10 +51,7 @@ class OnvifController:
|
|||||||
cam.onvif.port,
|
cam.onvif.port,
|
||||||
cam.onvif.user,
|
cam.onvif.user,
|
||||||
cam.onvif.password,
|
cam.onvif.password,
|
||||||
wsdl_dir=site.getsitepackages()[0].replace(
|
wsdl_dir=Path(find_spec("onvif").origin).parent / "../wsdl",
|
||||||
"dist-packages", "site-packages"
|
|
||||||
)
|
|
||||||
+ "/wsdl",
|
|
||||||
),
|
),
|
||||||
"init": False,
|
"init": False,
|
||||||
"active": False,
|
"active": False,
|
||||||
|
Loading…
Reference in New Issue
Block a user