python-gvm 24.6.0__py3-none-any.whl → 24.7.0__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.
Potentially problematic release.
This version of python-gvm might be problematic. Click here for more details.
- gvm/__version__.py +1 -1
- gvm/_enum.py +5 -5
- gvm/protocols/_protocol.py +4 -5
- gvm/protocols/core/_response.py +5 -4
- {python_gvm-24.6.0.dist-info → python_gvm-24.7.0.dist-info}/METADATA +1 -2
- {python_gvm-24.6.0.dist-info → python_gvm-24.7.0.dist-info}/RECORD +8 -8
- {python_gvm-24.6.0.dist-info → python_gvm-24.7.0.dist-info}/LICENSE +0 -0
- {python_gvm-24.6.0.dist-info → python_gvm-24.7.0.dist-info}/WHEEL +0 -0
gvm/__version__.py
CHANGED
gvm/_enum.py
CHANGED
|
@@ -4,12 +4,12 @@
|
|
|
4
4
|
#
|
|
5
5
|
|
|
6
6
|
from enum import Enum as PythonEnum
|
|
7
|
-
from typing import Any, Optional
|
|
8
|
-
|
|
9
|
-
from typing_extensions import Self
|
|
7
|
+
from typing import Any, Optional, Type, TypeVar
|
|
10
8
|
|
|
11
9
|
from gvm.errors import InvalidArgument
|
|
12
10
|
|
|
11
|
+
Self = TypeVar("Self", bound="Enum")
|
|
12
|
+
|
|
13
13
|
|
|
14
14
|
class Enum(PythonEnum):
|
|
15
15
|
"""
|
|
@@ -17,14 +17,14 @@ class Enum(PythonEnum):
|
|
|
17
17
|
"""
|
|
18
18
|
|
|
19
19
|
@classmethod
|
|
20
|
-
def _missing_(cls, value: Any) -> Optional[Self]:
|
|
20
|
+
def _missing_(cls: Type[Self], value: Any) -> Optional[Self]:
|
|
21
21
|
if isinstance(value, PythonEnum):
|
|
22
22
|
return cls.from_string(value.name)
|
|
23
23
|
return cls.from_string(str(value) if value else None)
|
|
24
24
|
|
|
25
25
|
@classmethod
|
|
26
26
|
def from_string(
|
|
27
|
-
cls,
|
|
27
|
+
cls: Type[Self],
|
|
28
28
|
value: Optional[str],
|
|
29
29
|
) -> Optional[Self]:
|
|
30
30
|
"""
|
gvm/protocols/_protocol.py
CHANGED
|
@@ -3,15 +3,14 @@
|
|
|
3
3
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
|
4
4
|
|
|
5
5
|
from types import TracebackType
|
|
6
|
-
from typing import Callable, Generic, Optional, Type
|
|
7
|
-
|
|
8
|
-
from typing_extensions import Self, TypeVar
|
|
6
|
+
from typing import Callable, Generic, Optional, Type, TypeVar
|
|
9
7
|
|
|
10
8
|
from gvm.connections import GvmConnection
|
|
11
9
|
|
|
12
10
|
from .core import Connection, Request, Response
|
|
13
11
|
|
|
14
|
-
T = TypeVar("T"
|
|
12
|
+
T = TypeVar("T")
|
|
13
|
+
Self = TypeVar("Self", bound="GvmProtocol")
|
|
15
14
|
|
|
16
15
|
|
|
17
16
|
def str_transform(response: Response) -> str:
|
|
@@ -45,7 +44,7 @@ class GvmProtocol(Generic[T]):
|
|
|
45
44
|
|
|
46
45
|
self._transform_callable = transform
|
|
47
46
|
|
|
48
|
-
def __enter__(self) -> Self:
|
|
47
|
+
def __enter__(self: Self) -> Self:
|
|
49
48
|
self.connect()
|
|
50
49
|
return self
|
|
51
50
|
|
gvm/protocols/core/_response.py
CHANGED
|
@@ -3,9 +3,7 @@
|
|
|
3
3
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
|
4
4
|
|
|
5
5
|
from functools import cached_property
|
|
6
|
-
from typing import Optional
|
|
7
|
-
|
|
8
|
-
from typing_extensions import Self
|
|
6
|
+
from typing import Optional, TypeVar
|
|
9
7
|
|
|
10
8
|
from gvm.errors import GvmError
|
|
11
9
|
from gvm.xml import Element, parse_xml
|
|
@@ -26,6 +24,9 @@ class StatusError(GvmError):
|
|
|
26
24
|
self.request = response.request
|
|
27
25
|
|
|
28
26
|
|
|
27
|
+
Self = TypeVar("Self", bound="Response")
|
|
28
|
+
|
|
29
|
+
|
|
29
30
|
class Response:
|
|
30
31
|
"""
|
|
31
32
|
A GMP Response
|
|
@@ -94,7 +95,7 @@ class Response:
|
|
|
94
95
|
status = self.status_code
|
|
95
96
|
return status is not None and 200 <= status <= 299
|
|
96
97
|
|
|
97
|
-
def raise_for_status(self) -> Self:
|
|
98
|
+
def raise_for_status(self: Self) -> Self:
|
|
98
99
|
if self.is_success:
|
|
99
100
|
return self
|
|
100
101
|
raise StatusError(
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: python-gvm
|
|
3
|
-
Version: 24.
|
|
3
|
+
Version: 24.7.0
|
|
4
4
|
Summary: Library to communicate with remote servers over GMP or OSP
|
|
5
5
|
Home-page: https://github.com/greenbone/python-gvm/
|
|
6
6
|
License: GPL-3.0-or-later
|
|
@@ -20,7 +20,6 @@ Classifier: Programming Language :: Python :: 3.12
|
|
|
20
20
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
21
21
|
Requires-Dist: lxml (>=4.5.0)
|
|
22
22
|
Requires-Dist: paramiko (>=2.7.1)
|
|
23
|
-
Requires-Dist: typing-extensions (>=4.9.0)
|
|
24
23
|
Project-URL: Documentation, https://greenbone.github.io/python-gvm/
|
|
25
24
|
Project-URL: Repository, https://github.com/greenbone/python-gvm/
|
|
26
25
|
Description-Content-Type: text/markdown
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
gvm/__init__.py,sha256=neZORsbiafvZp2ym_O3aLdhc-sQEYsNIZEfuI-9cEbw,433
|
|
2
|
-
gvm/__version__.py,sha256=
|
|
3
|
-
gvm/_enum.py,sha256=
|
|
2
|
+
gvm/__version__.py,sha256=Dweih-EMOhjWiWm_URCrMTi1Kixd26Z06ueZaWv6R2A,103
|
|
3
|
+
gvm/_enum.py,sha256=bxaotZwR1qMYk0exi_kKMbL_2ti2ZsyrIJwLGbBNotA,1193
|
|
4
4
|
gvm/connections/__init__.py,sha256=Be6SBv9aXOF1kZ2WHLhlA0WhFHfjef_6YmHpcKOS9oQ,810
|
|
5
5
|
gvm/connections/_connection.py,sha256=MrYX_9DaVOPa3-c9Gh7VfU9sCaNPBlBgv1I3OPUUPwc,3442
|
|
6
6
|
gvm/connections/_debug.py,sha256=38sE5lB33l-IUwDgP9PHQBp9vmax3_ZtacXglw0soF0,1908
|
|
@@ -9,11 +9,11 @@ gvm/connections/_tls.py,sha256=wELt16oLVMxcTJ5ALafgKb05jI58ngkV4AecyZQ8tAM,3610
|
|
|
9
9
|
gvm/connections/_unix.py,sha256=bp0d3Tkpn0sPRqPxFR5YjNHY2aaAlEp_hIn-uvgdGug,1653
|
|
10
10
|
gvm/errors.py,sha256=syLZpgGh6sUoZ-U-0YZsEUXeNMMbkE2i_k4u3k27E2Y,5317
|
|
11
11
|
gvm/protocols/__init__.py,sha256=zlahuZ4GCulfSA0WtRU9q1NVuf0a2f7g9B_ZAuXp88o,472
|
|
12
|
-
gvm/protocols/_protocol.py,sha256=
|
|
12
|
+
gvm/protocols/_protocol.py,sha256=nLiIJAOq0cvx-0QgLkND3oA3HRFlRwDLBjaNVjWB3Rk,4138
|
|
13
13
|
gvm/protocols/core/__init__.py,sha256=AV1deC-hXT_rnlvK0xDkq0nAgEk_dF0qLnxbg_9Rl1U,329
|
|
14
14
|
gvm/protocols/core/_connection.py,sha256=9i93gzeik6dJhPnAZTwtr7BMRlT_nOgRgwGJX7yBcq0,5736
|
|
15
15
|
gvm/protocols/core/_request.py,sha256=C5BeKn0O8G1VxVu67yRPT7orFijehEmf8nXdAjG5w3Q,338
|
|
16
|
-
gvm/protocols/core/_response.py,sha256=
|
|
16
|
+
gvm/protocols/core/_response.py,sha256=M8OSeMd7yPZGJZZWti_mr4mXKEdMpV8nWy4XYFiDrZc,2806
|
|
17
17
|
gvm/protocols/gmp/__init__.py,sha256=irp2DrP5lWQb10Gw3y5lIKWvDBnQAtPIitsHVtUf7wU,781
|
|
18
18
|
gvm/protocols/gmp/_gmp.py,sha256=A-rIg6eF-Wwz7BeSsFwL709THzUoc5wr3f9-j6T8kVI,4024
|
|
19
19
|
gvm/protocols/gmp/_gmp224.py,sha256=FWBeyfs35NbOgeT_-JKmngfLvp9E5HN4nkKERGVJ5Mg,145836
|
|
@@ -72,7 +72,7 @@ gvm/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
|
72
72
|
gvm/transforms.py,sha256=4VACfdIuZrybSowdp5wbWI7NOAdaIiwjU0oIE6jT2J4,1874
|
|
73
73
|
gvm/utils.py,sha256=GYBsCIdkH9-ziAk8uRv_gzMYuEFI6D14iFo80ZHCGtE,4590
|
|
74
74
|
gvm/xml.py,sha256=yG6OxnMJ7UfBSM6KmAH26v34OIJ4xDBx4KsVBVM8m3k,5714
|
|
75
|
-
python_gvm-24.
|
|
76
|
-
python_gvm-24.
|
|
77
|
-
python_gvm-24.
|
|
78
|
-
python_gvm-24.
|
|
75
|
+
python_gvm-24.7.0.dist-info/LICENSE,sha256=WJ7YI-moTFb-uVrFjnzzhGJrnL9P2iqQe8NuED3hutI,35141
|
|
76
|
+
python_gvm-24.7.0.dist-info/METADATA,sha256=s1vDW4vsdL-zbfl68nNzAr1ziu1u-xNlyMmKwSLrJEg,5826
|
|
77
|
+
python_gvm-24.7.0.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
78
|
+
python_gvm-24.7.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|