onvif-python 0.2.6__py3-none-any.whl → 0.2.8__py3-none-any.whl
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.
- onvif/__init__.py +3 -0
- onvif/cli/interactive.py +3 -2
- onvif/cli/main.py +3 -2
- onvif/services/devicemgmt.py +9 -0
- onvif/utils/service.py +32 -1
- onvif/wsdl/schema/common/b-2.xsd +580 -0
- onvif/wsdl/schema/common/bf-2.xsd +84 -0
- onvif/wsdl/schema/common/bw-2.wsdl +448 -0
- onvif/wsdl/schema/common/include +13 -0
- onvif/wsdl/schema/common/mpqf.xsd +1109 -0
- onvif/wsdl/schema/common/r-2.xsd +50 -0
- onvif/wsdl/schema/common/rw-2.wsdl +54 -0
- onvif/wsdl/schema/common/soap-envelope +165 -0
- onvif/wsdl/schema/common/t-1.xsd +185 -0
- onvif/wsdl/schema/common/ws-addr.xsd +144 -0
- onvif/wsdl/schema/common/xml.xsd +287 -0
- onvif/wsdl/schema/common/xmlmime +49 -0
- onvif/wsdl/ver10/actionengine.wsdl +1 -1
- onvif/wsdl/ver10/advancedsecurity/wsdl/advancedsecurity.wsdl +1 -1
- onvif/wsdl/ver10/appmgmt/wsdl/appmgmt.wsdl +1 -1
- onvif/wsdl/ver10/device/wsdl/devicemgmt.wsdl +115 -0
- onvif/wsdl/ver10/display/display.wsdl +1 -1
- onvif/wsdl/ver10/events/wsdl/bw-2-vs-mod.wsdl +2 -2
- onvif/wsdl/ver10/events/wsdl/event-vs.wsdl +4 -4
- onvif/wsdl/ver10/events/wsdl/event.wsdl +5 -5
- onvif/wsdl/ver10/federatedsearch.wsdl +1 -1
- onvif/wsdl/ver10/schema/metadatastream.xsd +1 -1
- onvif/wsdl/ver10/schema/onvif.xsd +25 -4
- onvif/wsdl/ver10/uplink/wsdl/uplink.wsdl +2 -2
- {onvif_python-0.2.6.dist-info → onvif_python-0.2.8.dist-info}/METADATA +4 -4
- {onvif_python-0.2.6.dist-info → onvif_python-0.2.8.dist-info}/RECORD +35 -23
- {onvif_python-0.2.6.dist-info → onvif_python-0.2.8.dist-info}/WHEEL +0 -0
- {onvif_python-0.2.6.dist-info → onvif_python-0.2.8.dist-info}/entry_points.txt +0 -0
- {onvif_python-0.2.6.dist-info → onvif_python-0.2.8.dist-info}/licenses/LICENSE.md +0 -0
- {onvif_python-0.2.6.dist-info → onvif_python-0.2.8.dist-info}/top_level.txt +0 -0
onvif/__init__.py
CHANGED
onvif/cli/interactive.py
CHANGED
|
@@ -13,6 +13,7 @@ from typing import List
|
|
|
13
13
|
from zeep.exceptions import TransportError, Fault
|
|
14
14
|
from requests.exceptions import RequestException
|
|
15
15
|
|
|
16
|
+
from .. import __version__
|
|
16
17
|
from ..client import ONVIFClient
|
|
17
18
|
from ..utils.exceptions import ONVIFOperationException
|
|
18
19
|
from .utils import (
|
|
@@ -194,7 +195,7 @@ class InteractiveShell(cmd.Cmd):
|
|
|
194
195
|
" / __ \\/ | / / | / / _/ ____/",
|
|
195
196
|
" / / / / |/ /| | / // // /_ ",
|
|
196
197
|
"/ /_/ / /| / | |/ // // __/ ",
|
|
197
|
-
"\\____/_/ |_/ |___/___/_/
|
|
198
|
+
f"\\____/_/ |_/ |___/___/_/ v{__version__}",
|
|
198
199
|
" ",
|
|
199
200
|
]
|
|
200
201
|
|
|
@@ -1400,7 +1401,7 @@ class InteractiveShell(cmd.Cmd):
|
|
|
1400
1401
|
super().do_help(line)
|
|
1401
1402
|
else:
|
|
1402
1403
|
help_text = f"""
|
|
1403
|
-
{colorize('ONVIF Interactive Shell —
|
|
1404
|
+
{colorize(f'ONVIF Interactive Shell — v{__version__}', 'cyan')}\n{colorize('https://github.com/nirsimetri/onvif-python', 'white')}
|
|
1404
1405
|
|
|
1405
1406
|
{colorize('Basic Commands:', 'yellow')}
|
|
1406
1407
|
capabilities, caps - Show device capabilities
|
onvif/cli/main.py
CHANGED
|
@@ -11,6 +11,7 @@ import json
|
|
|
11
11
|
from datetime import datetime
|
|
12
12
|
from typing import Any, Optional, Tuple
|
|
13
13
|
|
|
14
|
+
from .. import __version__
|
|
14
15
|
from ..client import ONVIFClient
|
|
15
16
|
from ..operator import CacheMode
|
|
16
17
|
from ..utils.discovery import ONVIFDiscovery
|
|
@@ -22,7 +23,7 @@ def create_parser():
|
|
|
22
23
|
"""Create argument parser for ONVIF CLI"""
|
|
23
24
|
parser = argparse.ArgumentParser(
|
|
24
25
|
prog="onvif",
|
|
25
|
-
description=f"{colorize('ONVIF Terminal Client', 'yellow')} —
|
|
26
|
+
description=f"{colorize('ONVIF Terminal Client', 'yellow')} — v{__version__}\nhttps://github.com/nirsimetri/onvif-python",
|
|
26
27
|
formatter_class=argparse.RawDescriptionHelpFormatter,
|
|
27
28
|
epilog=f"""
|
|
28
29
|
Examples:
|
|
@@ -188,7 +189,7 @@ def main():
|
|
|
188
189
|
|
|
189
190
|
# Show ONVIF CLI version
|
|
190
191
|
if args.version:
|
|
191
|
-
print(colorize(
|
|
192
|
+
print(colorize(__version__, "yellow"))
|
|
192
193
|
sys.exit(0)
|
|
193
194
|
|
|
194
195
|
# Handle product search
|
onvif/services/devicemgmt.py
CHANGED
|
@@ -104,6 +104,15 @@ class Device(ONVIFService):
|
|
|
104
104
|
def SetRemoteUser(self, RemoteUser=None):
|
|
105
105
|
return self.operator.call("SetRemoteUser", RemoteUser=RemoteUser)
|
|
106
106
|
|
|
107
|
+
def GetUserRoles(self, UserRole=None):
|
|
108
|
+
return self.operator.call("GetUserRoles", UserRole=UserRole)
|
|
109
|
+
|
|
110
|
+
def SetUserRole(self, UserRole):
|
|
111
|
+
return self.operator.call("SetUserRole", UserRole=UserRole)
|
|
112
|
+
|
|
113
|
+
def DeleteUserRole(self, UserRole):
|
|
114
|
+
return self.operator.call("DeleteUserRole", UserRole=UserRole)
|
|
115
|
+
|
|
107
116
|
def GetUsers(self):
|
|
108
117
|
return self.operator.call("GetUsers")
|
|
109
118
|
|
onvif/utils/service.py
CHANGED
|
@@ -1,12 +1,43 @@
|
|
|
1
1
|
# onvif/utils/service.py
|
|
2
2
|
|
|
3
3
|
import logging
|
|
4
|
+
import zeep.helpers
|
|
4
5
|
from .exceptions import ONVIFOperationException
|
|
5
6
|
|
|
6
7
|
logger = logging.getLogger(__name__)
|
|
7
8
|
logger.addHandler(logging.NullHandler())
|
|
8
9
|
|
|
9
10
|
|
|
11
|
+
class ONVIFResponse:
|
|
12
|
+
"""Transparent wrapper that adds to_dict() to zeep objects."""
|
|
13
|
+
|
|
14
|
+
def __init__(self, wrapped_object):
|
|
15
|
+
object.__setattr__(self, "_wrapped", wrapped_object)
|
|
16
|
+
|
|
17
|
+
def __getattr__(self, name):
|
|
18
|
+
return getattr(self._wrapped, name)
|
|
19
|
+
|
|
20
|
+
def __setattr__(self, name, value):
|
|
21
|
+
if name == "_wrapped":
|
|
22
|
+
object.__setattr__(self, name, value)
|
|
23
|
+
else:
|
|
24
|
+
setattr(self._wrapped, name, value)
|
|
25
|
+
|
|
26
|
+
def __repr__(self):
|
|
27
|
+
return repr(self._wrapped)
|
|
28
|
+
|
|
29
|
+
def __str__(self):
|
|
30
|
+
return str(self._wrapped)
|
|
31
|
+
|
|
32
|
+
def to_dict(self):
|
|
33
|
+
"""Convert zeep object to Python dictionary."""
|
|
34
|
+
return (
|
|
35
|
+
{}
|
|
36
|
+
if self._wrapped is None
|
|
37
|
+
else zeep.helpers.serialize_object(self._wrapped)
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
|
|
10
41
|
def _is_zeep_object(obj):
|
|
11
42
|
"""Check if an object is a Zeep-generated object.
|
|
12
43
|
|
|
@@ -104,7 +135,7 @@ class ONVIFService:
|
|
|
104
135
|
logger.debug(f"Calling wrapped ONVIF method: {name}")
|
|
105
136
|
result = attr(*args, **kwargs)
|
|
106
137
|
logger.debug(f"ONVIF method {name} completed successfully")
|
|
107
|
-
return result
|
|
138
|
+
return ONVIFResponse(result) if result is not None else result
|
|
108
139
|
except ONVIFOperationException as oe:
|
|
109
140
|
# Re-raise ONVIF exceptions as-is
|
|
110
141
|
service_name = getattr(self.operator, "service_name", "Unknown")
|