Skip to content

Commit e22cf4a

Browse files
committed
[Compat_v400] define classes as obsolete using warning
1 parent 35121a8 commit e22cf4a

2 files changed

Lines changed: 14 additions & 4 deletions

File tree

OMPython/Compat_v400/omc_session_cmd.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
import logging
77
from typing import Any, Optional
8+
import warnings
89

910
import pyparsing
1011

@@ -23,6 +24,13 @@ class OMCSessionCmd:
2324
"""
2425

2526
def __init__(self, session: OMSessionABC, readonly: bool = False):
27+
warnings.warn(
28+
message="The class OMCSessionCMD is depreciated and will be removed in future versions; "
29+
"please use OMCSession*.sendExpression(...) instead!",
30+
category=DeprecationWarning,
31+
stacklevel=2,
32+
)
33+
2634
if not isinstance(session, OMSessionABC):
2735
raise OMSessionException("Invalid OMC process definition!")
2836
self._session = session

OMPython/Compat_v400/omc_session_zmq.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,12 @@ def __init__(
3434
"""
3535
Initialisation for OMCSessionZMQ
3636
"""
37-
warnings.warn(message="The class OMCSessionZMQ is depreciated and will be removed in future versions; "
38-
"please use OMCProcess* classes instead!",
39-
category=DeprecationWarning,
40-
stacklevel=2)
37+
warnings.warn(
38+
message="The class OMCSessionZMQ is depreciated and will be removed in future versions; "
39+
"please use OMCProcess* classes instead!",
40+
category=DeprecationWarning,
41+
stacklevel=2,
42+
)
4143

4244
if omc_process is None:
4345
omc_process = OMCSessionLocal(omhome=omhome, timeout=timeout)

0 commit comments

Comments
 (0)