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.
Files changed (35) hide show
  1. onvif/__init__.py +3 -0
  2. onvif/cli/interactive.py +3 -2
  3. onvif/cli/main.py +3 -2
  4. onvif/services/devicemgmt.py +9 -0
  5. onvif/utils/service.py +32 -1
  6. onvif/wsdl/schema/common/b-2.xsd +580 -0
  7. onvif/wsdl/schema/common/bf-2.xsd +84 -0
  8. onvif/wsdl/schema/common/bw-2.wsdl +448 -0
  9. onvif/wsdl/schema/common/include +13 -0
  10. onvif/wsdl/schema/common/mpqf.xsd +1109 -0
  11. onvif/wsdl/schema/common/r-2.xsd +50 -0
  12. onvif/wsdl/schema/common/rw-2.wsdl +54 -0
  13. onvif/wsdl/schema/common/soap-envelope +165 -0
  14. onvif/wsdl/schema/common/t-1.xsd +185 -0
  15. onvif/wsdl/schema/common/ws-addr.xsd +144 -0
  16. onvif/wsdl/schema/common/xml.xsd +287 -0
  17. onvif/wsdl/schema/common/xmlmime +49 -0
  18. onvif/wsdl/ver10/actionengine.wsdl +1 -1
  19. onvif/wsdl/ver10/advancedsecurity/wsdl/advancedsecurity.wsdl +1 -1
  20. onvif/wsdl/ver10/appmgmt/wsdl/appmgmt.wsdl +1 -1
  21. onvif/wsdl/ver10/device/wsdl/devicemgmt.wsdl +115 -0
  22. onvif/wsdl/ver10/display/display.wsdl +1 -1
  23. onvif/wsdl/ver10/events/wsdl/bw-2-vs-mod.wsdl +2 -2
  24. onvif/wsdl/ver10/events/wsdl/event-vs.wsdl +4 -4
  25. onvif/wsdl/ver10/events/wsdl/event.wsdl +5 -5
  26. onvif/wsdl/ver10/federatedsearch.wsdl +1 -1
  27. onvif/wsdl/ver10/schema/metadatastream.xsd +1 -1
  28. onvif/wsdl/ver10/schema/onvif.xsd +25 -4
  29. onvif/wsdl/ver10/uplink/wsdl/uplink.wsdl +2 -2
  30. {onvif_python-0.2.6.dist-info → onvif_python-0.2.8.dist-info}/METADATA +4 -4
  31. {onvif_python-0.2.6.dist-info → onvif_python-0.2.8.dist-info}/RECORD +35 -23
  32. {onvif_python-0.2.6.dist-info → onvif_python-0.2.8.dist-info}/WHEEL +0 -0
  33. {onvif_python-0.2.6.dist-info → onvif_python-0.2.8.dist-info}/entry_points.txt +0 -0
  34. {onvif_python-0.2.6.dist-info → onvif_python-0.2.8.dist-info}/licenses/LICENSE.md +0 -0
  35. {onvif_python-0.2.6.dist-info → onvif_python-0.2.8.dist-info}/top_level.txt +0 -0
onvif/__init__.py CHANGED
@@ -1,5 +1,7 @@
1
1
  # onvif/__init__.py
2
2
 
3
+ __version__ = "0.2.8"
4
+
3
5
  from .client import ONVIFClient
4
6
  from .operator import CacheMode
5
7
  from .utils import (
@@ -22,4 +24,5 @@ __all__ = [
22
24
  "ONVIFCLI",
23
25
  "ONVIFDiscovery",
24
26
  "ONVIFParser",
27
+ "__version__",
25
28
  ]
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
- "\\____/_/ |_/ |___/___/_/ v0.2.6",
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 — v0.2.6', 'cyan')}\n{colorize('https://github.com/nirsimetri/onvif-python', 'white')}
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')} — v0.2.6\nhttps://github.com/nirsimetri/onvif-python",
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("0.2.6", "yellow"))
192
+ print(colorize(__version__, "yellow"))
192
193
  sys.exit(0)
193
194
 
194
195
  # Handle product search
@@ -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")