onvif-python 0.2.7__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 CHANGED
@@ -1,6 +1,6 @@
1
1
  # onvif/__init__.py
2
2
 
3
- __version__ = "0.2.7"
3
+ __version__ = "0.2.8"
4
4
 
5
5
  from .client import ONVIFClient
6
6
  from .operator import CacheMode
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")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: onvif-python
3
- Version: 0.2.7
3
+ Version: 0.2.8
4
4
  Summary: A modern Python library for ONVIF-compliant devices
5
5
  Author-email: Nirsimetri Technologies® <open@nirsimetri.com>
6
6
  Maintainer: Kaburagi
@@ -46,7 +46,7 @@ Dynamic: license-file
46
46
  <div align="center">
47
47
  <a href="https://app.codacy.com/gh/nirsimetri/onvif-python/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade"><img src="https://app.codacy.com/project/badge/Grade/bff08a94e4d447b690cea49c6594826d"/></a>
48
48
  <a href="https://deepwiki.com/nirsimetri/onvif-python"><img alt="Ask DeepWiki" src="https://deepwiki.com/badge.svg"></a>
49
- <a href="https://pypi.org/project/onvif-python/"><img alt="PyPI Version" src="https://img.shields.io/badge/PyPI-0.2.7-orange?logo=archive&color=yellow"></a>
49
+ <a href="https://pypi.org/project/onvif-python/"><img alt="PyPI Version" src="https://img.shields.io/badge/PyPI-0.2.8-orange?logo=archive&color=yellow"></a>
50
50
  <a href="https://pepy.tech/projects/onvif-python"><img alt="Pepy Total Downloads" src="https://img.shields.io/pepy/dt/onvif-python?label=Downloads&color=red"></a>
51
51
  <br>
52
52
  <a href="https://github.com/nirsimetri/onvif-python/actions/workflows/python-app.yml"><img alt="Build" src="https://github.com/nirsimetri/onvif-python/actions/workflows/python-app.yml/badge.svg?branch=main"></a>
@@ -362,7 +362,7 @@ usage: onvif [-h] [--host HOST] [--port PORT] [--username USERNAME] [--password
362
362
  [--cache {all,db,mem,none}] [--health-check-interval HEALTH_CHECK_INTERVAL] [--output OUTPUT] [--version]
363
363
  [service] [method] [params ...]
364
364
 
365
- ONVIF Terminal Client — v0.2.7
365
+ ONVIF Terminal Client — v0.2.8
366
366
  https://github.com/nirsimetri/onvif-python
367
367
 
368
368
  positional arguments:
@@ -443,7 +443,7 @@ Examples:
443
443
  <summary><b>2. Interactive Shell</b></summary>
444
444
 
445
445
  ```bash
446
- ONVIF Interactive Shell — v0.2.7
446
+ ONVIF Interactive Shell — v0.2.8
447
447
  https://github.com/nirsimetri/onvif-python
448
448
 
449
449
  Basic Commands:
@@ -1,4 +1,4 @@
1
- onvif/__init__.py,sha256=5vcj_YOxQVpXRRwWRPXGw4FngUsu59GkmzxwDxHELLQ,505
1
+ onvif/__init__.py,sha256=iV3SMNK-WdpehwTMjhrIpP7dltmsehTj356MUE174Jo,505
2
2
  onvif/client.py,sha256=_G00dKSvRkLKq5tDGm4XS_3fhSE3WJtYckK9WVzNj9c,27703
3
3
  onvif/operator.py,sha256=fBaoWYC3ZVFdgd2S_cmztWiLAA-HaWwSflq278YNlTs,13970
4
4
  onvif/cli/__init__.py,sha256=y3hc-mo-Iwwxf8m5vo9P_0m2ISzGuOy-jaRPkdRY05A,68
@@ -51,7 +51,7 @@ onvif/utils/discovery.py,sha256=YO44KiQhfcyUECNrRe4qe03DSh14GGVByu1W5ekbAXU,1476
51
51
  onvif/utils/error_handlers.py,sha256=MwPNfUeDA6d_nNZ01P0Ut67ERBYVvjsYrRsQhIo28yc,4851
52
52
  onvif/utils/exceptions.py,sha256=5DxvqKAL7w038qPFeWmtkR5F3jWK0nz0qerzsOQPh0k,7788
53
53
  onvif/utils/parser.py,sha256=QYzzIqsP1RuSIdx0SYPnighomYkLsfroRPMcjGOmgeo,5125
54
- onvif/utils/service.py,sha256=ccmJs7PVb1yTdN-cu2VU_aaY8t8Cvw2QndQNT_ZCUJc,12835
54
+ onvif/utils/service.py,sha256=t-9ZdUUV5-PAHDrfQ3pxZXRUqIEUsTn6Pg-Dr5CHVB0,13697
55
55
  onvif/utils/wsdl.py,sha256=MuQ-2L0M3eXQcKfhOeUgGqZMTXI3iIbCO8tyQR09mn4,27796
56
56
  onvif/utils/xml_capture.py,sha256=r8N2_D1hbKywMdftlTTMnxPhzxOsJDLkEJDKgudfpbo,7984
57
57
  onvif/utils/zeep.py,sha256=nXY7gxYV806EQhA4ZlUR4YZDb4retDBgp6iDOumqa48,29740
@@ -126,9 +126,9 @@ onvif/wsdl/ver20/util/federated_search_documentation.html,sha256=GR6a4SPBsRDisaW
126
126
  onvif/wsdl/ver20/util/fedsearch-docu-viewer.xsl,sha256=8eP-uMZgsTtuU5WaVyCzs_DJZqWIFD7iRz_5-3ComPg,325
127
127
  onvif/wsdl/ver20/util/onvif-wsdl-viewer.xsl,sha256=Emauxs6rh69IxlxlU3k_LEH_i3SsRbwIKUk-VcMlVgk,94525
128
128
  onvif/wsdl/ver20/util/operationIndex.html,sha256=mUsAGgNUFCIQjVV9Rx_O5YUNW3EdWNhUkAbBY-xVMhQ,39290
129
- onvif_python-0.2.7.dist-info/licenses/LICENSE.md,sha256=ya8FumJeUkFWwCMkG9KdMxHWRWMNhtI3vHzzAWPQS8s,1091
130
- onvif_python-0.2.7.dist-info/METADATA,sha256=e3Y-cj2hSRKJeDAGhwNVAL3qZ13ciJstBle3IAB3JGs,62247
131
- onvif_python-0.2.7.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
132
- onvif_python-0.2.7.dist-info/entry_points.txt,sha256=7xUdI64yzWh7YfNPQDKCW9cT8XIgWuNCloikP9-yjqY,46
133
- onvif_python-0.2.7.dist-info/top_level.txt,sha256=MqCi1uJmIvtVFJDz2IxLbpwq6FwDtWhqrWQtKwLaQg4,6
134
- onvif_python-0.2.7.dist-info/RECORD,,
129
+ onvif_python-0.2.8.dist-info/licenses/LICENSE.md,sha256=ya8FumJeUkFWwCMkG9KdMxHWRWMNhtI3vHzzAWPQS8s,1091
130
+ onvif_python-0.2.8.dist-info/METADATA,sha256=xQvH25ENd6nVrfua-ntiEtGCSHj021AWnBLbKrcX-jA,62247
131
+ onvif_python-0.2.8.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
132
+ onvif_python-0.2.8.dist-info/entry_points.txt,sha256=7xUdI64yzWh7YfNPQDKCW9cT8XIgWuNCloikP9-yjqY,46
133
+ onvif_python-0.2.8.dist-info/top_level.txt,sha256=MqCi1uJmIvtVFJDz2IxLbpwq6FwDtWhqrWQtKwLaQg4,6
134
+ onvif_python-0.2.8.dist-info/RECORD,,