Skip to content

Commit be0b398

Browse files
committed
Revert accidental changes
1 parent 182db3e commit be0b398

File tree

2 files changed

+15
-8
lines changed

2 files changed

+15
-8
lines changed

src/ansys/tools/common/launcher/interface.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,13 @@
2222

2323
"""Interface definitions for implementing a local product launcher.
2424
25-
A plugin for the Local Product Launcher must implement the :class:`LauncherProtocol`
25+
A plugin for the local product launcher must implement the :class:`LauncherProtocol`
2626
class and register it.
2727
"""
2828

29+
from collections.abc import Mapping
2930
from enum import Enum, auto
31+
from types import MappingProxyType
3032
from typing import Any, ClassVar, Protocol, TypeVar, runtime_checkable
3133

3234
from .grpc_transport import TransportOptionsType
@@ -119,7 +121,7 @@ class LauncherProtocol(Protocol[LAUNCHER_CONFIG_T]):
119121
used in the configuration CLI, if available.
120122
"""
121123

122-
SERVER_SPEC: dict[str, ServerType]
124+
SERVER_SPEC: ClassVar[Mapping[str, ServerType]] = MappingProxyType({})
123125
"""Defines the server types that are started.
124126
125127
Examples
@@ -130,7 +132,12 @@ class LauncherProtocol(Protocol[LAUNCHER_CONFIG_T]):
130132
131133
.. code:: python
132134
133-
SERVER_SPEC = {"MAIN": ServerType.GENERIC, "FILE_TRANSFER": ServerType.GRPC}
135+
SERVER_SPEC = MappingProxyType(
136+
{
137+
"MAIN": ServerType.GENERIC,
138+
"FILE_TRANSFER": ServerType.GRPC,
139+
}
140+
)
134141
135142
The :attr:`.ProductInstance.urls` attribute then has keys
136143
``{"MAIN", "FILE_TRANSFER"}``, whereas the

src/ansys/tools/common/launcher/product_instance.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -103,15 +103,15 @@ def stop(self, *, timeout: float | None = None) -> None:
103103
104104
Parameters
105105
----------
106-
timeout :
106+
timeout : float, default: None
107107
Time in seconds after which the instance is forcefully stopped.
108108
Not all launch methods implement this parameter. If the parameter
109109
is not implemented, it is ignored.
110110
111111
Raises
112112
------
113113
ProductInstanceError
114-
If the instance is already in the stopped state.
114+
If the instance is already stopped.
115115
"""
116116
if self.stopped:
117117
raise ProductInstanceError("Cannot stop the server. It has already been stopped.")
@@ -123,7 +123,7 @@ def restart(self, stop_timeout: float | None = None) -> None:
123123
124124
Parameters
125125
----------
126-
stop_timeout :
126+
stop_timeout : float, default: None
127127
Time in seconds after which the instance is forcefully stopped.
128128
Not all launch methods implement this parameter. If the parameter
129129
is not implemented, it is ignored.
@@ -141,7 +141,7 @@ def check(self, timeout: float | None = None) -> bool:
141141
142142
Parameters
143143
----------
144-
timeout :
144+
timeout : float, default: None
145145
Time in seconds to wait for the servers to respond. There
146146
is no guarantee that the ``check()`` method returns within this time.
147147
Instead, this parameter is used as a hint to the launcher implementation.
@@ -156,7 +156,7 @@ def wait(self, timeout: float) -> None:
156156
157157
Parameters
158158
----------
159-
timeout :
159+
timeout : float, default: None
160160
Wait time in seconds before raising an exception.
161161
162162
Raises

0 commit comments

Comments
 (0)