Skip to content

Commit

Permalink
chore: add warnings
Browse files Browse the repository at this point in the history
make IDEs signal deprecated code instead of relying on runtime logs only
  • Loading branch information
JarbasAl committed Jan 4, 2025
1 parent c0bc457 commit fa0cd19
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ovos_dinkum_listener/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
from ovos_utils.log import LOG, log_deprecation
from ovos_utils.process_utils import ProcessStatus, StatusCallbackMap, ProcessState

import warnings
from ovos_dinkum_listener._util import _TemplateFilenameFormatter
from ovos_dinkum_listener.plugins import load_stt_module, load_fallback_stt, FakeStreamingSTT
from ovos_dinkum_listener.transformers import AudioTransformersService
Expand Down Expand Up @@ -310,6 +311,11 @@ def default_save_path(self):

@property
def state(self):
warnings.warn(
"reference `self.status.state` instead",
DeprecationWarning,
stacklevel=2,
)
log_deprecation("This property is deprecated, reference `status.state`",
"0.1.0")
if self.status.state in (ProcessState.NOT_STARTED, ProcessState.ALIVE):
Expand Down

0 comments on commit fa0cd19

Please sign in to comment.