From 34a6e4a6626d61fc41c4f412baacc630252356e3 Mon Sep 17 00:00:00 2001 From: JarbasAi Date: Fri, 29 Dec 2023 20:13:00 +0000 Subject: [PATCH] deprecation logs --- ovos_utils/intents/converse.py | 8 +++++--- ovos_utils/intents/intent_service_interface.py | 4 ++-- ovos_utils/intents/layers.py | 7 +++---- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/ovos_utils/intents/converse.py b/ovos_utils/intents/converse.py index ca8995ea..8f8c6e6e 100644 --- a/ovos_utils/intents/converse.py +++ b/ovos_utils/intents/converse.py @@ -2,9 +2,7 @@ import ovos_utils.messagebus from ovos_utils.intents.intent_service_interface import IntentQueryApi -from ovos_utils.log import LOG, log_deprecation - -log_deprecation("ConverseTracker has been deprecated without replacement", "0.1.0") +from ovos_utils.log import LOG, deprecated class ConverseTracker: @@ -20,6 +18,10 @@ class ConverseTracker: last_conversed = None intent_api = None + @deprecated("ConverseTracker has been deprecated without replacement", "0.1.0") + def __init__(self): + pass + @classmethod def connect_bus(cls, mycroft_bus): """Registers the bus object to use.""" diff --git a/ovos_utils/intents/intent_service_interface.py b/ovos_utils/intents/intent_service_interface.py index 09b0cd67..cddadff5 100644 --- a/ovos_utils/intents/intent_service_interface.py +++ b/ovos_utils/intents/intent_service_interface.py @@ -3,7 +3,7 @@ from typing import List, Tuple, Optional import ovos_utils.messagebus -from ovos_utils.log import LOG, log_deprecation +from ovos_utils.log import LOG, log_deprecation, deprecated from ovos_utils.file_utils import to_alnum # backwards compat import @@ -373,8 +373,8 @@ class IntentQueryApi: Query Intent Service at runtime """ + @deprecated("IntentQueryApi has been deprecated without replacement", "0.1.0") def __init__(self, bus=None, timeout=5): - LOG.warning("IntentQueryApi has been deprecated and will be removed in 0.1.0") if bus is None: bus = ovos_utils.messagebus.get_mycroft_bus() self.bus = bus diff --git a/ovos_utils/intents/layers.py b/ovos_utils/intents/layers.py index 56097604..e1c62ede 100644 --- a/ovos_utils/intents/layers.py +++ b/ovos_utils/intents/layers.py @@ -1,6 +1,5 @@ -from ovos_utils.log import LOG, log_deprecation +from ovos_utils.log import LOG, deprecated -log_deprecation("IntentLayers moved to ovos_workshop.decorators.layers", "0.1.0") try: from ovos_workshop.decorators.layers import IntentLayers @@ -10,9 +9,9 @@ from time import sleep class IntentLayers: + + @deprecated("IntentLayers moved to ovos_workshop.decorators.layers", "0.1.0") def __init__(self, bus=None, layers=None): - # TODO: Deprecate in 0.1.0 - LOG.error(f"This module is deprecated, import from `ovos_workshop.skills.layers") layers = layers or [] self.bus = bus or ovos_utils.messagebus.get_mycroft_bus() # make intent levels for N layers